Skip to content

Commit ff28b91

Browse files
committed
πŸš€[feat] μžλ°” - switch ν‘œν˜„μ‹
1 parent 7f86db1 commit ff28b91

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package practiceJAVA;
2+
3+
public class SwitchExpressions {
4+
public static void main(String[] args) {
5+
6+
char grade = 'c';
7+
8+
switch (grade) {
9+
case 'A', 'a' -> {
10+
System.out.println("우수 νšŒμ›μž…λ‹ˆλ‹€.");
11+
}
12+
case 'B', 'b' -> {
13+
System.out.println("일반 νšŒμ›μž…λ‹ˆλ‹€.");
14+
}
15+
case 'C', 'c' -> {
16+
System.out.println("휴면 νšŒμ›μž…λ‹ˆλ‹€.");
17+
}
18+
}
19+
20+
/* switch (grade) {
21+
case 'A':
22+
case 'a':
23+
System.out.println("우수 νšŒμ›μž…λ‹ˆλ‹€.");
24+
break;
25+
case 'B':
26+
case 'b':
27+
System.out.println("일반 νšŒμ›μž…λ‹ˆλ‹€.");
28+
break;
29+
default:
30+
System.out.println("휴면 νšŒμ›μž…λ‹ˆλ‹€.");
31+
}*/
32+
33+
}
34+
}

0 commit comments

Comments
Β (0)