About Question enthuware.jwpv6.2.732 :
Moderator: admin
- 
				Sireesha
 
About Question enthuware.jwpv6.2.732 :
The options 4 and 5 seems to be the same. But answer picks 4 but not 5 why?
			
			
									
									
						
		Online		
						
						
		
				
		
		
	- 
				admin
 - Site Admin
 - Posts: 10443
 - Joined: Fri Sep 10, 2010 9:26 pm
 - Contact:
 
Re: About Question enthuware.jwpv6.2.732 :
No, they are different. 4 is right. The reason is explained in the explanation.
HTH,
Paul.
			
			
									
									
						HTH,
Paul.
- 
				JoeAllen
 - Posts: 13
 - Joined: Thu Jul 11, 2013 11:22 pm
 - Contact:
 
Re: About Question enthuware.jwpv6.2.732 :
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?
			
			
									
									
						<%@ 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?
		Online		
						
						
		
				
		
		
	- 
				admin
 - Site Admin
 - Posts: 10443
 - Joined: Fri Sep 10, 2010 9:26 pm
 - Contact:
 
Re: About Question enthuware.jwpv6.2.732 :
autoFlush is occurs twice in this option.
			
			
									
									
						- 
				shareef.hiasat
 - Posts: 20
 - Joined: Thu Dec 19, 2013 8:22 am
 - Contact:
 
Re: About Question enthuware.jwpv6.2.732 :
so if autoFlush occurs twice means its not valid and will not compile ?!admin wrote:autoFlush is occurs twice in this option.
		Online		
						
						
		
				
		
		
	- 
				admin
 - Site Admin
 - Posts: 10443
 - Joined: Fri Sep 10, 2010 9:26 pm
 - Contact:
 
Re: About Question enthuware.jwpv6.2.732 :
Yes, you cannot repeat this attribute.
			
			
									
									
						- 
				kunalh
 - Posts: 1
 - Joined: Sun Dec 06, 2015 12:04 am
 - Contact:
 
Re: About Question enthuware.jwpv6.2.732 :
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
			
			
									
									
						Thanks
		Online		
						
						
		
				
		
		
	- 
				admin
 - Site Admin
 - Posts: 10443
 - Joined: Fri Sep 10, 2010 9:26 pm
 - Contact:
 
Re: About Question enthuware.jwpv6.2.732 :
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.- 
				johnlong
 - Posts: 197
 - Joined: Mon Jun 20, 2016 5:06 pm
 - Contact:
 
Re: About Question enthuware.jwpv6.2.732 :
Import may occur multiple times, the problem is with flush attribute.Any page directive except import can only occur only once.
Please confirm, explanation is not quite correct.
		Online		
						
						
		
				
		
		
	- 
				admin
 - Site Admin
 - Posts: 10443
 - Joined: Fri Sep 10, 2010 9:26 pm
 - Contact:
 
Re: About Question enthuware.jwpv6.2.732 :
Why do you think the explanation is incorrect? It says that same thing you are saying i.e. import can occur multiple times.
			
			
									
									
						- 
				johnlong
 - Posts: 197
 - Joined: Mon Jun 20, 2016 5:06 pm
 - Contact:
 
Re: About Question enthuware.jwpv6.2.732 :
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.
			
			
									
									
						
		Online		
						
						
		
				
		
		
	- 
				admin
 - Site Admin
 - Posts: 10443
 - Joined: Fri Sep 10, 2010 9:26 pm
 - Contact:
 
Re: About Question enthuware.jwpv6.2.732 :
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.
			
			
									
									
						So I am not really sure what are you confused about.
- 
				johnlong
 - Posts: 197
 - Joined: Mon Jun 20, 2016 5:06 pm
 - Contact:
 
Re: About Question enthuware.jwpv6.2.732 :
Actually import can appear multiple times, but without contradictory flush attribute.
			
			
									
									
						Who is online
Users browsing this forum: No registered users and 4 guests