SWITCH CASE USING JAVA

public class Switch{
    public static void main(String []args){

        int n =2;
        switch(n){

            case 0:
            System.out.println("i am best");
            break;
            case 1:
            System.out.println("hello namste");
            break;
            case 2:
            System.out.println("welcome my blog");
            break;
            case 3 :
            System.out.println("exit the blog");
            break;
            
            default :
          System.out.println("plz try again");
          break;

            
        }
    }
    
}

Add a Comment

Your email address will not be published. Required fields are marked *