[
package sara;
import java.util.Scanner;
public class Sara {
public static void main(String[] args) {
System.out.println( "Enter month " );
int month;
Scanner in=new Scanner(System.in);
month=in.nextInt();
switch(month)
{
Case 1: System.out.println("january"); break; // error
Case 2: System.out.println("feburary"); break; // error
Case 3: System.out.println("march"); break; //error
default:System.out.println("invalid month"); break;
}
}
}
]/[
Enter month
jan
Exception in thread "main" java.util.InputMismatchException
at java.util.Scanner.throwFor(Scanner.java:909)
at java.util.Scanner.throwFor(Scanner.java:909)
at java.util.Scanner.next(Scanner.java:1530)
at java.util.Scanner.nextInt(Scanner.java:2160)
at java.util.Scanner.nextInt(Scanner.java:2119)
at sara.Sara.main(Sara.java:11)
Java Result: 1
BUILD SUCCESSFUL (total time: 8 seconds)
]
--- Update ---
error in switch getting
--- Update ---
eeroin switch help plz frnds output is not coming properly