mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-14 18:18:48 +00:00
11 lines
201 B
Java
11 lines
201 B
Java
public class Switch26 {
|
|
String switchPatternMatching(int i) {
|
|
return switch (i) {
|
|
case 1 -> "one";
|
|
case 5 -> "five";
|
|
case int y when y >= 0 -> "+" + y;
|
|
case int y -> "-" + -y;
|
|
};
|
|
}
|
|
}
|