This question already has an answer here:
- Semicolon at end of 'if' statement 18 answers
if(x>0);
{
System.out.println("x");
}
Normally;
if(x>0)
{
System.out.println("x");
}
with this x cannot be displayed. but when there is semicolon after the if statement x is displayed.
can you explain it?
Aucun commentaire:
Enregistrer un commentaire