-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswitchcase.java
More file actions
22 lines (21 loc) · 796 Bytes
/
switchcase.java
File metadata and controls
22 lines (21 loc) · 796 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import java.util.Scanner;
public class switchcase {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Enter your age: ");
int age = scanner.nextInt();
switch (age){
/*case 18:
System.out.println("u are going to become adult");
break;
case 23:
System.out.println("u are going to join job");
break;
default:
System.out.println("u are not in the specified age groups");*/
case 18 -> System.out.println("u are going to become adult");
case 23 -> System.out.println("u are g18oing to join job");
default -> System.out.println("u are not in the specified age groups");
}
}
}