Solved

The Code List< String > MyLs = New ArrayList< String >( );

Question 47

Multiple Choice

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:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents