Menu
×
×
Correct!

Exercise:

Complete the switch statement, and add the correct keyword at the end to specify some code to run if there is no case match in the switch statement.

int day = 4; switch (day) { case 1: System.out.println("Saturday"); break; case 2: System.out.println("Sunday"); break; default: System.out.println("Weekend"); }

Not Correct

Click here to try again.

Correct!

Next ❯
int day = 4;
switch () {
   1:
    System.out.println("Saturday");
    break;
   2:
    System.out.println("Sunday");
    ;
  :
    System.out.println("Weekend");
}

  
  
  




Go to w3schools.com
Reset Score
Close This Menu

Completed 0 of 59 Exercises:

Java Syntax
Java Variables
Java Data Types
Java Operators
Java Strings
Java Math
Java Booleans
Java If...Else
Java Switch
Java Loops
Java Arrays
Java Methods
Java Classes/Objects
Java Exceptions





×

Reset the Score?

This will reset the score of ALL 59 exercises.

Are you sure you want to continue?



×

Congratulations!

You have finished all 59 Java exercises.

Share your score on facebook: