Curioustab
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Home
»
Java Programming
»
Objects and Collections
Which statement is true for the class java.util.ArrayList?
The elements in the collection are ordered.
The collection is guaranteed to be immutable.
The elements in the collection are guaranteed to be unique.
The elements in the collection are accessed using a unique key.
Correct Answer:
The elements in the collection are ordered.
Explanation:
Yes, always the elements in the collection are ordered.
← Previous Question
Next Question→
More Questions from
Objects and Collections
Which of the following statements about the hashcode() method are incorrect? The value returned by hashcode() is used in some collection classes to help locate objects. The hashcode() method is required to return a positive int value. The hashcode() method in the String class is the one inherited from Object. Two new empty String objects will produce identical hashcodes.
Which statement is true? class Test1 { public int value; public int hashCode() { return 42; } } class Test2 { public int value; public int hashcode() { return (int)(value^5); } }
Discussion & Comments
No comments yet. Be the first to comment!
Name:
Comment:
Post Comment
Join Discussion
Discussion & Comments