Page 1 of 1
					
				About Question enthuware.jwpv6.2.732 :
				Posted: Fri Jul 13, 2012 9:39 pm
				by Sireesha
				The options 4 and 5 seems to be the same. But answer picks 4 but not 5 why?
			 
			
					
				Re: About Question enthuware.jwpv6.2.732 :
				Posted: Sun Jul 15, 2012 7:57 pm
				by admin
				No, they are different. 4 is right. The reason is explained in the explanation.
HTH,
Paul.
			 
			
					
				Re: About Question enthuware.jwpv6.2.732 :
				Posted: Tue Jul 16, 2013 5:08 am
				by JoeAllen
				Option 1: 
<%@ page import="java.util.*" autoFlush="true"%>
<%@ page import="java.io.*" autoFlush="false"%>
Explanation: Any page directive except import can only occur only once.
So Option 1 should be correct based on the explanation, right?
			 
			
					
				Re: About Question enthuware.jwpv6.2.732 :
				Posted: Tue Jul 16, 2013 6:31 am
				by admin
				autoFlush is occurs twice in this option.
			 
			
					
				Re: About Question enthuware.jwpv6.2.732 :
				Posted: Wed Dec 17, 2014 2:06 pm
				by shareef.hiasat
				admin wrote:autoFlush is occurs twice in this option.
so if autoFlush occurs twice means its not valid and will not compile ?!
 
			 
			
					
				Re: About Question enthuware.jwpv6.2.732 :
				Posted: Wed Dec 17, 2014 7:47 pm
				by admin
				Yes, you cannot repeat this attribute.
			 
			
					
				Re: About Question enthuware.jwpv6.2.732 :
				Posted: Sun Dec 06, 2015 12:11 am
				by kunalh
				Can anyone please explain why option 5 is wrong? I am not able to get a clear understanding from the explanation given in the Test Studio
Thanks
			 
			
					
				Re: About Question enthuware.jwpv6.2.732 :
				Posted: Sat Dec 12, 2015 10:04 pm
				by admin
				There is ! sign in Option 5 and so it is a declaration and will be converted to something like:
Code: Select all
public class test$jsp extends HttpServlet
{
  Hashtable ht = new Hashtable();
  
  ht.put("max", "10"); //1  This line is not ok.
  ....
  public void _jspService(...){ ... }
}
[code]
As you can see Line marked //1 is not valid java code.
HTH,
Paul.
 
			 
			
					
				Re: About Question enthuware.jwpv6.2.732 :
				Posted: Wed Aug 17, 2016 8:53 am
				by johnlong
				Any page directive except import can only occur only once.
Import may occur multiple times, the problem is with flush attribute.
Please confirm, explanation is not quite correct.
 
			 
			
					
				Re: About Question enthuware.jwpv6.2.732 :
				Posted: Wed Aug 17, 2016 9:43 am
				by admin
				Why do you think the explanation is incorrect? It says that same thing you are saying i.e. import can occur multiple times.
			 
			
					
				Re: About Question enthuware.jwpv6.2.732 :
				Posted: Wed Aug 17, 2016 1:53 pm
				by johnlong
				I does not say that the problem is with flush attribute being contradictory in two imports, i.e. multiple imports are fine, unless we don't specify different flush attributes.
			 
			
					
				Re: About Question enthuware.jwpv6.2.732 :
				Posted: Wed Aug 17, 2016 8:53 pm
				by admin
				The code in the option uses autoFlush twice. And the explanation clearly says, "Any page directive except import can only occur only once." 
So I am not really sure what are you confused about.
			 
			
					
				Re: About Question enthuware.jwpv6.2.732 :
				Posted: Thu Aug 18, 2016 12:25 am
				by johnlong
				Actually import can appear multiple times, but without contradictory flush attribute.