[Solved]Java 1 Use Methods Exercises Write Statement S Problems Don T Need Write Entire Class Dec Q37223142
(JAVA)
1) We will use some of these methods in these exercises. Justwrite the statement(s) for these problems, you don’t need write theentire class.

A. Declare an ArrayList named grades of five elements of typeDouble and initialize the elements (starting withthe first) to the values 100.0, 67.8, 89.6, 34.5, 67.9,respectively.
Answer:
B. Given an ArrayList a, write an expressionthat refers to the first ( index 0) of the ArrayList.
Answer:
C. Given an ArrayList a, which contains 50elements , write an expression that refers to the last element ofthe array .
Answer:
D. Given that an ArrayList named a withelements of type Integer has been declared , assign/add 3 to itsfirst element .
Answer:
E. Given that an ArrayList named a withelements of type String has been declared . Write an expressionthat will obtain the size a and store it in anappropriate variable.
Answer:
F. Given that an ArrayList named a withelements of type Integer has been declared , assign/add 3 to its5th element .
Answer:
Method Description ArrayList<string> example adds the given value at the end of the list list.add (“end”) add (value) add (index, value dds the given value at the given index, 1ist.add (1, “middle”) shifting subsequent values right removes all elements from the list gets the value at the given index removes the value at the given index, shifting subsequent values left list.clear) list.get (1) list.remove (1); clear() get (index) remove (index) set (index, value replaces the value at the given list.set (2, “hello”); index with the given value returns the current number of elements in the list size() list.size() Show transcribed image text Method Description ArrayList example adds the given value at the end of the list list.add (“end”) add (value) add (index, value dds the given value at the given index, 1ist.add (1, “middle”) shifting subsequent values right removes all elements from the list gets the value at the given index removes the value at the given index, shifting subsequent values left list.clear) list.get (1) list.remove (1); clear() get (index) remove (index) set (index, value replaces the value at the given list.set (2, “hello”); index with the given value returns the current number of elements in the list size() list.size()
Expert Answer
Answer to (JAVA) 1) We will use some of these methods in these exercises. Just write the statement(s) for these problems, you don�… . . .
OR

