permaculture playing cards*
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
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Question 26 of HFSJ Final mocktest
 
Similar Threads
Final Mock Test Question 26 Head First and Servlets
Question regarding answers in HFSJ 2nd ed mock exam
HFSJ mock exam 2 Question -Standard Actions
HFJS (V2) Final Mock Question 26 is wrong?
HFSJ 2nd edition Mock exam questions 6, 11,26,34,49 and 69