Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Paragraph 1. Research for API document of interface List. Which package does it

ID: 3876454 • Letter: P

Question

Paragraph 1. Research for API document of interface List. Which package does it belong to? What are known classes implementing this interface? What is the method signature of method contains? (return type and parameters) What is the method signature of method size? (return type and parameters) Describe the usage of set method . . 2. Research utility classes Collections and Arrays. What methods in these classes you find most useful? Code writing exercise: 3. Suppose an ArrayList named plist is a list of Shakespeare plays. a) How do make a method call to get the size of the list? b) How do make a method call to get the 5th element of the list? c) How do make a method call to get the index of the play Henry V? d) Write a "for each loop" statament to print out play names 4. Initialize an ArrayList called cardList of type Card. 5. The list object numlist consists of Integer objects 3451 12 6 8 15 34 20 10 The program starts with the original nunList. List Integer> duplist new Arraylist Integerl ) Eex. (Integer unliat)( ,C ( k

Explanation / Answer

If you post more then 1 question, as per chegg guidelines I have to answer only one question.

1.

(a) List interface belongs to the utility package i.e:

java.util

(b) The classes implementing this interface are ArrayList, LinkedList etc.

(c) The signature of contains method is

So, return type is boolean and the parameter is of type Object.

(d)

The signature of size method is

So, return type is int and there are no parameters.

(e) The method set

void set(int i, Element x)

is used to update the value of the element at given index i with value x.