About Question enthuware.jwpv6.2.732 :
Moderator: admin
About Question enthuware.jwpv6.2.732 :
The options 4 and 5 seems to be the same. But answer picks 4 but not 5 why?
-
- Site Admin
- Posts: 10383
- 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.
-
- 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?
-
- Site Admin
- Posts: 10383
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.jwpv6.2.732 :
autoFlush is occurs twice in this option.
-
- 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.
-
- Site Admin
- Posts: 10383
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.jwpv6.2.732 :
Yes, you cannot repeat this attribute.
-
- 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
-
- Site Admin
- Posts: 10383
- 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.
-
- 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.
-
- Site Admin
- Posts: 10383
- 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.
-
- 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.
-
- Site Admin
- Posts: 10383
- 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.
-
- 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 11 guests