wood burning stoves 2.0*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Question 26 of HFSJ Final mocktest Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Question 26 of HFSJ Final mocktest" Watch "Question 26 of HFSJ Final mocktest" New topic
Author

Question 26 of HFSJ Final mocktest

geeta vemula
Ranch Hand

Joined: Jul 18, 2008
Posts: 208
Given:
Which of the following lines of code, if inserted independently at Line 5, will cause the text within the ctherwise tag to display? (Choose all that apply)
A. books.add("");
B. books.add(null);
C. books.clear();
D. books.add("Head First");
E. books = null;


Answer is BD,

I thought it would be E. Also the explanation gviven in the book is not satisfying. What is the correct answer?
Omer Haderi
Ranch Hand

Joined: Sep 27, 2006
Posts: 42
hi

the answer is C and E. Maybe there is a typo!

A, B and D are wrong because all of them add something to the books list and the list is NOT empty.
 
Don't get me started about those stupid light bulbs.
 
subject: Question 26 of HFSJ Final mocktest