CJCoding With Joseph
15free / daySign inCreate account
Back to Code Walkthrough

Nested If Statements

Java code walkthrough · Question 21
mediumIf Statements

Code

Read carefully. What does this print?
1public class Main {
2 public static void main(String[] args) {
3 int x = 15;
4 if (x > 10) {
5 if (x > 20) {
6 System.out.println("big");
7 } else {
8 System.out.println("medium");
9 }
10 } else {
11 System.out.println("small");
12 }
13 }
14}

Your answer