aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Doubt in a mock exam question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Doubt in a mock exam question" Watch "Doubt in a mock exam question" New topic
Author

Doubt in a mock exam question

Rancy Chadha
Ranch Hand

Joined: Jul 12, 2006
Posts: 135
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.


Thanks,<br />-Rancy
arun shanmugam kumar
Greenhorn

Joined: Apr 02, 2005
Posts: 25
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.
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9243
    
    1

By the way what it means to say <prefix:suffix attr='vector' />??


SCJP 1.4, SCWCD 1.4 - Hints for you, SCBCD Hints - Demnachst, SCDJWS - Auch Demnachst
Did a rm -R / to find out that I lost my entire Linux installation!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Doubt in a mock exam question
 
Similar Threads
Doubt in a tag handler question
TLD Doubt
Question on tld
<taglib> and uri doubt
EduardoCobian Q 29