0
Can anyone help me here?
public class Program { public static void main(String[] args) { int a=1; if(a>3); { System.out.println(a); }}} Here the output is 1 ,even though a>3.This is because if terminator in if statement.Please explain
2 Réponses
0
You have put semi colon to (;) to if statement remove that semicolon.
if(a>3) ;
0
If you put semicolon to if statement, the compiler will not consider it as a if statement so the comparsion will not be performed
Hope it helps