• Post Reply Bookmark Topic Watch Topic
  • New Topic

OCA exam question  RSS feed

 
Alexandru Puiu
Greenhorn
Posts: 22
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I'm currently preparing for the OCA exam using the book from J. Boyarsky and S. Selikoff. In the review I've encountered the following question with the following correct answer (accordingly to the answers at the end of the book) :

Which of the following are true?
B. Two ArraysLists with the same content are equal.

I've said that it is false, just because it is incomplete. I mean two ArrayLists are equal if they have the same content in the same order, right? Is this a mistake in the book? Or if I encounter this answer on the exam, I should check that the answer is correct?

Thanks in advance!
Alex 
 
Campbell Ritchie
Marshal
Posts: 56578
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, let's fire one back:-
An ArrayList and a LinkedList containing the same content are equal: T/F?

I would have thought that in the current context, i.e. Lists, content includes order, but you have a point that the wording of that question is ambiguous.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37507
552
Eclipse IDE Java VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think "same content" includes order too. On the exam, you'll know how many answers are correct which sometimes helps with ambiguity. Also, the exam is more likely to ask you a question like this with code (vs English.) We do both to ensure you know it really well.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!