Computer Applications
Format the following if statements with indentation:if (x == y) {if (y == z) x = 1; y = 2; } else z = 1;
Related Questions
Rewrite the following if statement, using the switch statement:
if (choice == 1) System.out.println("You selected One"); else if (choice == 2) System.out.println("You selected Two"); else if (choice == 3) System.out.println("You selected Three"); else if (choice == 4) System.out.println("You selected Four"); else if (choice == 5) System.out.println("You selected Five"); else if (choice == 6) System.out.println("You selected Six"); else System.out.println("Invalid choice");
Format the following if statements with indentation: if (x == y) if (x == z) x = 1; else y = 1; else z = 1;
Format the following if statements with indentation:if (num1 != num2) {
if (num2 >= num3) x = 1; y = 2; }
else {x = 1; if (num1 == num2) z = 3;}Explain the use of System.exit(n) method in Java.