I get a lot of errors over what should be a simple constructor for a fighter class. Furthermore, they seem to be illegal start of expression errors or ; expected errors, for the most part.
This is my code:
class Fighter(String name, int health, int attack, int defense){
//default constructor
//input constructor
private String name;
private int health;
private int attack;
private int defense;
private String setName(){
this.name = name;
}
public String getName(){
return name;
}
private int setHealth(){
this.health = health;
}
public int getHealth(){
return health;
}
private int setAttack(){
this.attack = attack;
}
public int getAttack(){
return attack;
}
private int setDefense(){
this.defense = defense;
}
public int getDefense(){
return defense;
}
}
What am I doing to generate all of these errors? Is it related to private or public methods?