Question: The main method in the ListExecutionTimes program contains this local variable initialization statement: ArrayList list = new ArrayList (); After determining ArrayList execution times, we
The main method in the ListExecutionTimes program contains this local variable initialization statement:
ArrayList
After determining ArrayList execution times, we modified the program by replacing the above statement with this:
LinkedList
Declare the list variable in a way that allows you to assign an ArrayList object to it initially and then later assign a LinkedList object to it. Specifically, provide a declaration statement for list, an assignment statement for an ArrayList and an assignment statement for a LinkedList. Why can you assign either an ArrayList object or a LinkedList object to this same variable?
Step by Step Solution
3.43 Rating (150 Votes )
There are 3 Steps involved in it
In Java different types of Lists ArrayList LinkedList etc are all polylithic in nature theyre all de... View full answer
Get step-by-step solutions from verified subject matter experts
