The code
List< String > myLs = new ArrayList< String >( ) ;
Uses a List < String > interface variable to reference the concrete ArrayList< String > object.
The advantage of doing this is
A) the class of the collection object can later be changed to LinkedList,or even Vector,without needing to change anything else in the program
B) the class of the collection object can later be changed to LinkedList,Vector,TreeSet,or even HashSet,without needing to change anything else in the program
C) the program compiles faster
D) None of the above: the statement is a type error.
Correct Answer:
Verified
Q40: Which of the following is true?
A) A
Q41: The enhanced for loop,when used on a
Q42: Which of the following is true?
A) The
Q43: In a Map object
A) It is possible
Q44: The ListIterator method that replaces an existing
Q45: Which of the following is true?
A) Collections
Q46: ListIterator is a subinterface of
A) Collection
B) Iterator
C)
Q48: An object that can compare two other
Q49: A collection suitable for use in an
Q50: The concrete classes of the JCF that
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents