• Post Reply Bookmark Topic Watch Topic
  • New Topic

Question 26 of HFSJ Final mocktest

 
geeta vemula
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!