Question: you will create a Java class of your choice, instantiate several objects of that class, add those object to an ArrayList, and manipulate that list

you will create a Java class of your choice, instantiate several objects of that class, add those object to an ArrayList, and manipulate that list using several methods from the ArrayList class. Create a class of your own selection. It should have at least 2 instance variables, 2 constructors, toString(), and equals(). In a different class, create a main method. In main, instantiate at least 8 objects of the class you created in step 1 above. Add those objects to an ArrayList which uses your class as its base type. Go to the Java API (Application Programming Interface) for ArrayLists and read about the ArrayList class, along with its constructors and methods: https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html Along with the set, get, remove, trimToSize, and clear methods, select at least 5 other methods from the API and use them on your ArrayList. Identify the 5 methods in your Introductory Comments and/or in your code. Do not use an iterator. Write two paragraphs on the differences and similarities between arrays, the Vector class, and the ArrayList class. Identify the advantages and disadvantages of each. Submit a listing of the class created in step 1 above, a listing of the class containing main, and the paragraphs written in the last step above. Make sure that you identify the 5 other methods you used besides those listed in step 6 above.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!