Switch Statment use and within Scanner - LearnHowToCode SarkariResult.com Interview Questions and Answers LearnHowToCodeOnline
Switch Statment use and within Scanner

Switch Statment use and within Scanner

import java.util.*;
public class SwitchEx{
public static void main(String[]args)
{
    Scanner sc=new Scanner(System.in);
    System.out.println("Enter your lack number 1 To 10 between ");
int number =sc.nextInt();
   
   switch(number){
 //case statement

  case 1: System.out.println();
  break;
 
  case 2: System.out.println(" MY Love is Your Love");
  break;


  case 3: System.out.println("I need you");
  break;


  case 4: System.out.println("Baby Can I hold you");
  break;


 case 5: System.out.println("Kiss from a rose");
  break;

 case 6: System.out.println("Next To Me ");
  break;

 case 7: System.out.println("I like YOu you are so good");
  break;

 case 8: System.out.println(" I can manage within you" );
  break;

 case 9: System.out.println(" nothing special");
  break;

 case 10: System.out.println("will you marry me");
  break;
default: System.out.println("Invaild your lacky num....reagain input");
   }
  }
}

that is result:
c:/shashi/javac SwitchEx.java
c:/shashi/java SwitchEx
Enter you lacky no   5
Kiss from a rose

About EasyToCode

I'm Ethan Mariano a software engineer by profession and reader/writter by passion.I have good understanding and knowledge of AngularJS, Database, javascript, web development, digital marketing and exploring other technologies related to Software development.

0 comments:

Featured post

Political Full Forms List

Acronym Full Form MLA Member of Legislative Assembly RSS Really Simple Syndication, Rashtriya Swayamsevak Sangh UNESCO United Nations E...

Powered by Blogger.