aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Final Mock Exam question 3 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Final Mock Exam question 3" Watch "Final Mock Exam question 3" New topic
Author

Final Mock Exam question 3

Deepak Jain
Ranch Hand

Joined: Aug 05, 2006
Posts: 637
HFSJ 2nd edition question 3.
Question:
There is a tag definition with two attributes "userId" and "size".
userId is declared as mandatory [required=true]
size is declared as optional attribute.


Since size is optional attribute the tag handler class need not have setter method and size member variable. Is this statement correct?


SCJP, SCWCD, SCBCD
Pramod Shivale
Greenhorn

Joined: Mar 26, 2008
Posts: 14
This statement is incorrect. The userId attribute is optional, but when you do specify this attribute and its value in the tag, it requires the setter method in the tag handler class to set the value for this attribute.
Deepak Jain
Ranch Hand

Joined: Aug 05, 2006
Posts: 637
userId attribute is required while size attribute is optional.
raja ram
Ranch Hand

Joined: Mar 02, 2008
Posts: 169
Hi,
Is this statement correct?


Yes, When you do not specify it there is no problem,say when we specify it then you need to have setter for it.

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Final Mock Exam question 3