This question already has an answer here:
- Semicolon at end of 'if' statement 15 answers
public class applicatiion {
public static void main(String[] args) {
int myInt = 5;
if(myInt < 5); {
System.out.println("Less than 5");
}
else if(myInt > 5); {
System.out.println("Greater than 5");
}
else {
System.out.println("None of the above");
}
}
}
Not sure whats wrong. Quite new to java and just testing. I havent been able to find whats wrong when I checked on different forums.
Aucun commentaire:
Enregistrer un commentaire