diff options
Diffstat (limited to 'tests/features193/Switch1.java')
-rw-r--r-- | tests/features193/Switch1.java | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/tests/features193/Switch1.java b/tests/features193/Switch1.java index 1daeeff6f..625fe15a0 100644 --- a/tests/features193/Switch1.java +++ b/tests/features193/Switch1.java @@ -7,11 +7,14 @@ public class Switch1 { } public static int one(Color color) { - int result = switch(color) { - case R -> 0; - case G -> 1; - case B -> 2; - default -> 3; + int result = switch (color) { + case R -> 0; + case G -> { + int number4 = 8 / 2; + yield number4 /4; + } + case B -> 2; + default -> 3; }; return result; } @@ -19,4 +22,4 @@ public class Switch1 { enum Color { R, G, B, Y; -}
\ No newline at end of file +} |