Hi All, I have a doubt regarding a question from 'http://www.javaranch.com/carl/SCWCD.htm' mock exam. This is the 29th question, it goes like this:
Which statements are correct regarding the following jsp lines that use a tag library? <%! Vectot vector =new java.util.Vector();%> <% vector.addElement(�one�); vector.addElement(�two�); %> <prefix:suffix attr='vector' />
1) A vector can't be assigned to a tag handler attribute 2) The program will compile and assign the vector's content to the attribute attr. 3) The program will assign the content of vector if assigment is: attr='<%= vector %>'
The answer of this quesion is option 3. My doubt is, Why is option 2 not correct. Why doesnt the code work with variable vector assigned to the attribute. Please clear my doubt.
The option says the value of vector variable will be assigned to attr but thats false. According to the code attr will have the value 'vector' and not the contents of vector reference variable. Thats why option 2 is wrong.