Question: Create an ExtendableArray class that uses an array of integer to store data ( integers ) . Implement an add ( element ) method that

Create an ExtendableArray class that uses an array of integer to store data (integers). Implement an add (element) method that always places the new element to index 0 of the array. If the array is full, extend the arrays capacity by 50%. Implement a display() method that displays the array size (number of elements stored in the array), array capacity, and array contents. Create an instance of the class in the static void main() method to test your implementation. You can set the initial capacity of the array to 6. Then when you atte XH17 mpt to insert a 7th element to the array, its capacity should be increased to 9

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 Programming Questions!