I have a class
public abstract class BoardLocation
{
//...
}
and another…
public abstract class Property extends BoardLocation
{
public abstract int getRentAmt();
}
and finally, another…
public class Lot extends Property
{
@Override
public int getRentAmt()
{
//...
}
}
In my Driver.java I’m doing…
BoardLocation board[] = new BoardLocation[2];
board[0] = new Lot();
board[1] = new Lot();
but when I try to call…
board[0].getRentAmt();
I get that “Can not find symbol” and it says that board[0] is a BoardLocation.
Any reason this might be? Or any fixes?
1 Answer