Answers for "swith case in java"

1

switch statement in java

// syntax of switch statement in java
switch(expression)
{
   case 1 value :
   // code goes here
   break;

   case 2 value :
   // code goes here
   break;

   case 3 value :
   // code goes here
   break;
   .
   .
   .
   .
   
   default: // optional
   // default code goes here
}
Posted by: Guest on November-25-2020
0

switch cases: JAVA

int day = 4;
switch (w3exercise_input_no_0) {
  w3exercise_input_no_1 1:
    System.out.println("Saturday");
    break;
  w3exercise_input_no_2 2:
    System.out.println("Sunday");
    w3exercise_input_no_3;
  w3exercise_input_no_4:
    System.out.println("Weekend");
}
Posted by: Guest on September-03-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language