I have to build a stack of comparable objects from a given interface. Inside the class, this is my constructor:
public S()
{
Comparable[] arr = new Comparable[INITSIZE];
size = 0;
}
Now, in every method where the array appears, for example:
public void push(Comparable x)
{
arr[size++] = x;
}
I get cannot find symbol error related to arr while compiling. Why?