-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathusingswitch.java
More file actions
28 lines (26 loc) · 812 Bytes
/
usingswitch.java
File metadata and controls
28 lines (26 loc) · 812 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import java.util.Scanner;
public class usingswitch{
public static void main(String[] args){
Scanner sc= new Scanner(System.in);
System.out.println("Enter your age :");
int age;
age= sc.nextInt();
sc.close();
switch (age){
case 18:
System.out.println("to be adult");
break;
case 25:
System.out.println("in your twenties");
break;
case 42:
System.out.println("semi-old");
break;
case 60:
System.out.println("retirement");
break;
default:
System.out.println("leave it bro :)");
}
}
}