Wanted to show that certain data structures in Java can be created by you. In this example, we'll go ahead and create an ArrayList data structure that has some of the methods that the built in ArrayList class has. We'll create 2 constructors: The default constructor that creates an ArrayList with a default size of 10. Constructor that allows an initial size to be passed to the array. We'll also create a number of methods: void add(Object x); A method that allows you to place an Object at the end of the ArrayList. void add(int index, Object x); A method that allows you to place a value at a given location. Object get(int index): Allows you to retrieve a value of the arrayList array from a given location. int size(); Allows you to get the number of elements currently in the Arraylist. boolean isEmpty(); Tests to see if the Arraylist is empty. boolean isIn(Object x); A method that sees if a particular object exist in the arrayList. int ...
The True purpose of education is to make minds, not careers.