I making a dynamic array that using normal array and mimic arraylist. So.... Please help me check if the method is correct. rangeCheck is a boolean method checking if the array is out of bound. rangeCheck contains an outofbound exception.
public int get(int position)
{
rangeCheck(position);
int valuePosition =0;
for(int count=0;count == position;count++)
{
valuePosition = storage[count] ;
}
return valuePosition;
}
For some idiotic reason, I keep thinking inorder to get to some value at some specific index, I have to go in a loop to do it....