Page 1 of 1

About Question enthuware.jwpv6.2.1063 :

Posted: Sun Jan 20, 2013 6:03 am
by harsh.sahajwani
The answer to this question is correct - "None of these will work". But the reason should be that the Jsp will not compile, because there is no import statement written in the JSP to import ArrayList. And it is not asked to be assumed in the question. There should be the following statement in the jsp for it to be able to compile first:

<%@ page import="java.util.*" %>

Currently the question only states JSP as:

<%
ArrayList cities = new ArrayList();
cities.add("NYC");
cities.add("SFO");
%>

Once the page compiles, only after that we can talk about what would be the result of the JSP. And after that the rest of the explanation is also correct.

Re: About Question enthuware.jwpv6.2.1063 :

Posted: Sun Jan 20, 2013 7:47 am
by admin
Sure. The code has been modified to use java.util.ArrayList to avoid this ambiguity.

thank you for your feedback!