-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathcwh_18_elseif.java
45 lines (39 loc) · 1.33 KB
/
cwh_18_elseif.java
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package com.company;
import java.util.Scanner;
public class cwh_18_elseif {
public static void main(String[] args) {
String var = "Saurabh";
switch (var) {
case "Shubham" -> {
System.out.println("You are going to become an Adult!");
System.out.println("You are going to become an Adult!");
System.out.println("You are going to become an Adult!");
}
case "Saurabh" -> System.out.println("You are going to join a Job!");
case "Vishaka" -> System.out.println("You are going to get retired!");
default -> System.out.println("Enjoy Your life!");
}
System.out.println("Thanks for using my Java Code!");
/*
int age;
System.out.println("Enter Your Age");
Scanner sc = new Scanner(System.in);
age = sc.nextInt();
if (age>56){
System.out.println("You are experienced!");
}
else if(age>46){
System.out.println("You are semi-experienced!");
}
else if(age>36){
System.out.println("You are semi-semi-experienced!");
}
else{
System.out.println("You are not experienced");
}
if(age>2){
System.out.println("You are not a baby!");
}
*/
}
}