+ 1

Please tell everyone why it is showing error?

public class Program { public static void main(String[] args) { int a = 8; boolean correct = true; boolean wrong = false; if (a<=16); { System.out.println(correct); } else { System.out.println(wrong); } } }

22nd Oct 2021, 4:42 PM
Mayukh Banerjee
Mayukh Banerjee - avatar
3 odpowiedzi
+ 3
Remove the semicolon after the `if` conditional if( a <= 16 ) // remove semicolon ;
22nd Oct 2021, 5:01 PM
Ipang
+ 1
Plz anyone
22nd Oct 2021, 4:47 PM
Mayukh Banerjee
Mayukh Banerjee - avatar
+ 1
Thanks 🙏
22nd Oct 2021, 5:28 PM
Mayukh Banerjee
Mayukh Banerjee - avatar