So I'm attempting to create a very simple program to practice some basic Java formatting skills. However, something about the "fight()" is driving my compiler crazy. Does anyone see why? Thanks in advance for any answers I receive, code below:
class Hero{
String name;
int Intelligence;
boolean parents;
public static fight(Hero1, Hero2){
if(Hero1.Intelligence>Hero2.Intelligence){
return(Hero1.name+" is the winner");
else
return(Hero2.name+" is the winner");
}
}
}
class HeroMain{
public static void main(String[] args){
Hero Superman = new Hero();
Superman.name = "Superman";
Superman.Intelligence = 7;
Superman.parents = false;
Hero Batman = new Hero();
Batman.name = "Batman";
Batman.Intelligence = 8;
Batman.parents = false;
public fight(Superman, Batman);
}
}