File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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

Question 26 of HFSJ Final mocktest

geeta vemula
Ranch Hand

Joined: Jul 18, 2008
Posts: 208
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

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.
I agree. Here's the link:
subject: Question 26 of HFSJ Final mocktest
It's not a secret anymore!