Need Help

I have my removeFirst and removeAll working in my Integer class. But I don't know how to find the value in the those two methods. Can somebody please help me. Thanks

publicclass IntegerList

{

int[] list;//values in the list

int elements, number;

//-

//create a list of the given size

//-

public IntegerList(int size)

{

list =newint[size];

number = size;

elements = 0;

}

//-

//fill array with integers between 1 and 100, inclusive

//-

publicvoid randomize()

{

for (int i=0; i<list.length; i++)

list[i] = (int)(Math.random() * 100) + 1;

number = list.length;

}

//-

//print array elements with indices

//-

publicvoid print()

{

for (int i=0; i><list.length; i++)

System.out.println(i +":\t" + list[i]);

}

//-

//Add an increase in size method

//-

publicvoid increaseSize()

{

//create an new array and double the size

int[] myarray =newint[list.length * 2];

//copy all existing elements

for (int i = 0; i >< elements; i++)

myarray[i] = list[i];

//make the original array point to the larger, new array

list = myarray;

number = list.length;

}

//-

//Add a method that adds new element

//-

publicvoid addElement (int elements)

{

// check if the new element has no space, if so increase the size

if (elements + 1 > list.length)

increaseSize();

//store the element

list[elements] = elements;

// we have an additional element

elements++;

}

//-

//Add a method that removes an element

//-

publicvoid removeFirst (int val)

{

for (int i = loc; i < list.length; i++)

list[i] = list[i +1 ];

// have one less elements

elements--;

}

//-

//Add a method that removes all the elements

//-

publicvoid removeAll (int all)

{

for(int r = 0; r < elements; r++)

list[r] = 0;

elements = 0;

}

}

[4783 byte] By [tmlucky13a] at [2007-11-27 3:00:33]
# 1
> public void removeAll (int all)huh? What's "all" doing there?
DrLaszloJamfa at 2007-7-12 3:41:46 > top of Java-index,Java Essentials,New To Java...
# 2
It should be public void removeAll (int val). I am trying to get to find the value in it's location in those removeFirst and removeAll method.
tmlucky13a at 2007-7-12 3:41:46 > top of Java-index,Java Essentials,New To Java...
# 3
I'm just as confused. Why do you need to pass a value -- no matter what you name the parameter? I mean, you don't use it in the code.
DrLaszloJamfa at 2007-7-12 3:41:46 > top of Java-index,Java Essentials,New To Java...
# 4
Are you supposed to remove all of the instances of the specified value? If so then you need to loop over the list, and when the element matches the parameter, remove it. If not, then could you be a little more clear with what you're trying to do?
hunter9000a at 2007-7-12 3:41:46 > top of Java-index,Java Essentials,New To Java...