Question: Help with Java Please answer the following questions: Both in java.util and in our class, List is an interface. Which of the following statements are
Help with Java
Please answer the following questions:


Both in java.util and in our class, List is an interface. Which of the following statements are true? a Using interface types like List allows us to easily switch implementations (such as switching out the ArcayList> for a LinkedList> ) without breaking code in main Java allows us to create new objects of type List A List variable can store the address of any object whose class implements the List interface (such as ArrayLists and LinkedList ) a List variable can store the address of any object Java allows us to create variables of type List An interface type like List specifies method headers but not necessarily any method bodies Why are iterators often provided with a data structure? Note: there may be more than one correct answer here (or none at all). An iterator helps to justify high salaries for software developers. Providing an iterator enables the use of a for-each loop An iterator allows for the client (method main) a way to access items in the collection while keeping the underlying data structure details private. An iterator provides a way to iterate through and items in a data structure without needing to use index numbers. Which of the following statements are true? Note: there may be more than one correct answer here (or none at all). Linked lists require more memory than fixed-size Java arrays because additional reference variables are needed to keep track of next nodes Arraylists and linked lists require identical amounts of memory, which is why we can switch between them in the code in one line Java's fixed sized arrays require more memory, which is why array lists and linked lists were created to address that problem Arraylists typically require more memory than fixed-size Java arrays because there can be additional (unused) capacity in an arraylist
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
