Это мой дочерний класс:
public class User extends Alien
{
protected XYCoordination currentLocation;
protected int energyCanister;
protected int lifePoints;
public User (XYCoordination currentLocation, int energyCanister, int lifePoints)
{
super(currentLocation);
}
public int collectCanister()
{
super.collectCanister();
return energyCanister;
}
public int caculateLifePoints(int lifePoints)
{
super.caculateLifePoints(lifePoints);
return lifePoints;
}
}
Это мой родительский класс:
public class Alien
{
protected XYCoordination currentLocation;
protected Planet currentPlanet;
protected int energyCanister;
protected int lifePoints;
protected int n;
public Alien(XYCoordination currentLocation, int energyCanister, int lifePoints)
{
this.currentLocation = currentLocation;
this.energyCanister = energyCanister;
this.lifePoints = lifePoints;
}
public XYCoordination moveRight(XYCoordination toRight)
{
currentLocation = currentLocation.addXToRight(toRight);
return currentLocation;
}
public XYCoordination moveUp(XYCoordination toUp)
{
currentLocation = currentLocation.addYToUp(toUp);
return currentLocation;
}
public XYCoordination moveLeft(XYCoordination toLeft)
{
currentLocation = currentLocation.addXToLeft(toLeft);
return currentLocation;
}
public XYCoordination moveDown(XYCoordination toDown)
{
currentLocation = currentLocation.addYToDown(toDown);
return currentLocation;
}
public int collectCanister()
{
energyCanister = energyCanister + (int)(n*currentPlanet.getRemainingCanister());
return energyCanister;
}
public int caculateLifePoints(int lifePoints)
{
lifePoints = (int)((2/3)*lifePoints);
return lifePoints;
}
public void displayInfo()
{
System.out.print("Currently you are in:" + currentLocation + "\t Currently you have" + energyCanister + "canisters" + "\tCurrently you have" + lifePoints + "lifepoints");
}
}
Всегда говорят "не могу найти символ" супер "."