1int time = 22;
2if (time < 10) {
3 System.out.println("Good morning.");
4} else if (time < 20) {
5 System.out.println("Good day.");
6} else {
7 System.out.println("Good evening.");
8}
9// Outputs "Good evening."
1int x = 3;
2
3if (x == 3) {
4 // block of code to be executed if the condition is true
5} else {
6 // block of code to be executed if the condition is false
7}
1int x = 3;
2
3if (x == 3) {
4 // block of code to be executed if the condition is true
5}