Campbell Ritchie wrote:Welcome to the Ranch and thank you for supplying enough information to identify where the code comes from.
Does the book say anything about assuming imports?
I would think that you should assume that is correct code because there are no compiler errors in the code. Otherwise you would say that it won't compile because it is not inside a method. And assuming the code compiles, as PL has told you, what would your answer be? And what would you say if the third line read like this?
List<String> two = new LinkedList<>();
@Campbell Ritchie Thanks:)
I think now my answer would be B. (ArrayList implements equals method; compares whether two ArrayLists contain the same elements in the same order).
Even if the third line was replaced with a LinkedList, the answer would still be B ( i think LinkedList also overrides equals() method) . Am I correct in assuming so?