-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCH_04_02.java
More file actions
88 lines (65 loc) · 1.8 KB
/
Copy pathCH_04_02.java
File metadata and controls
88 lines (65 loc) · 1.8 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import java.util.Scanner;
public class CH_04_02 {
public static void main(String[] args) {
/* System.out.println("Enter your age");
Scanner sc = new Scanner(System.in);
int age = sc.nextInt();
if (age >56) {
System.out.println("You are experience");
}
else if (age>46)
{
System.out.println("You are semi experience");
}
else if (age>36)
{
System.out.println("You are semi-semi experience");
}
else
{
System.out.println("You are not experience");
}
*/
/*
int age = 58;
switch (age) {
case 18 :
System.out.println("You are going to become adult");
break;
case 23:
System.out.println("You are getting a job");
break;
case 68:
System.out.println("You are getting a retier");
break;
default:
System.out.println("Enjoy your life");
}
System.out.println("thanks");
*/
/* char var = 'r';
switch (var) {
case 'r' :
System.out.println("You are going to become adult");
break;
case 'g':
System.out.println("You are getting a job");
break;
case 'h':
System.out.println("You are getting a retier");
break;
default:
System.out.println("Enjoy your life");
}
System.out.println("thanks");
*/
String name = "Atharva";
switch (name) {
case "Atharva" -> System.out.println("You are going to become adult");
case "Harry" -> System.out.println("You are getting a job");
case "Shubham" -> System.out.println("You are getting a retier");
default -> System.out.println("Enjoy your life");
}
System.out.println("thanks");
}
}