223k views
2 votes
"java code

Part 1.Solving using an ArrayList and its inbuilt methods Write a Java program and do the following steps: (one-by-one) a) Create an ArrayList and add the following names: i. Xiu Wang ii.jackson robin iii.samantha Kelly iv.yusuf Khan v.hannah Taylor vi.amaya jones

1 Answer

4 votes

Final answer:

To solve this task using an ArrayList and its inbuilt methods in Java, you can follow these steps: create an ArrayList object, add the names to the list using the add() method, access the elements using the get() method and index, and use the size() method to find the number of elements.

Step-by-step explanation:

  1. Create an ArrayList object to store the names.
  2. Use the ArrayList add() method to add the names to the list.
  3. Access the elements of the ArrayList using get() method and index number.
  4. Use the size() method to find the number of elements in the ArrayList.

User Brightbyte
by
7.2k points