Switch Case in Java


Here is the simple program for printing basic switch case example in Java.

Source Code

import java.io.*;
import java.util.Scanner;
class swi
{
  public static void main(String args[])
  {
   int ch=3;
   switch(ch)
   {
    case 1:
      System.out.println("One");
    break;
    case 2:
      System.out.println("Two");
    break;
    case 3:
      System.out.println("Three");
    break;
    default:
      System.out.println("Invalid No");
    break;
   }
  }
}
To download raw file Click Here

Output

Three


Learn All in Tamil © Designed & Developed By Tutor Joes