1.Become familiar with the dynamic allocation of array storage
2.Become familiar with ArrayList

Create your myIntArrayList class that is functionally similar to the formal Java ArrayList class.

Your myIntArrayList should contain the following methods and characteristics:

*Should contain a default constructor myIntArrayList()
*Should contain an alternative constructor myIntArrayList(int[] anArray) that allows the user to create an initial myIntArrayList that is equivalent to an array that is passed to the constructor
◦Should contain an alternative constructor myIntArrayList(myIntArrayList anExample) that will create an intMyArrayList identical to one that is passed to it
◦Should contain an void add(int index, int value) method
◾Need to check for appropriate index. If index is outside of the array boundaries, then add at the beginning or the end
◦Should contain a int remove(int index) method
◾If the index is outside of the array boundaries, then remove the first or last element
◦ Should contain a myIntArrayList simpleSort() method that will return another myIntArrayList object with the contents of the current object sorted using an insertion sort.
◦Should contain a int get(int index) method
◾If index is out of boundary then return either the first or last element
◦Should contain an int indexOf(int value) method
◾Returns the index of the first occurance of value
◦ Should contain an boolean isEmpty() method
◦Should contain a int size() method
◦ Should contain a void clear() method that empties the myIntArryList
◦ Should contain a void print() method that prints all elements of the myIntArrayList in one row delimited by one space

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

public class myIntArrayList {
public int[] array;

public myIntArrayList()
array = new int[0];

public myIntArrayList(int[] anArray)
array = new int[anArray.length];
for(int i = 0; i < anArray.length; i++)
array[i] = anArray[i];...

By purchasing this solution you'll be able to access the following files:

50% discount

$36.00 $18.00
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Java Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Upload a file
Continue without uploading

We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats