Question: 1. What role does a Java interface play between the interface designer and the programmer who codes a class that implements the interface? A. contract
1. What role does a Java interface play between the interface designer and the programmer who codes a class that implements the interface?
- A. contract
- B. constructor
- C. message
- D. instance variable
2. Which of the following statements about the performance of ArrayList are true?
- A. Its get method can take up to n steps, i.e., the required effort depends on the size of the list.
- B. Its get method never takes more than a small constant number of steps, i.e., the required effort does not depend on the size of the list.
- C. Its add and remove methods never take more than a small constant number of steps, i.e., the required effort does not depend on the size of the list, even when items are added or removed somewhere other than the end of the list.
- D. Its add and remove methods can take up to n steps, i.e., the required effort depends on the size of the list, especially when items are added or removed somewhere other than the end of the list.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
