diff options
Diffstat (limited to 'src/test/resources/java/switch-statements/com/example')
| -rw-r--r-- | src/test/resources/java/switch-statements/com/example/SwitchStatements.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/test/resources/java/switch-statements/com/example/SwitchStatements.java b/src/test/resources/java/switch-statements/com/example/SwitchStatements.java new file mode 100644 index 0000000..bebccf9 --- /dev/null +++ b/src/test/resources/java/switch-statements/com/example/SwitchStatements.java @@ -0,0 +1,30 @@ +package com.example; + +public class SwitchStatements { + public static int simpleReturn(String value) { + switch (value) { + case "one": + return 1; + default: + return 0; + } + } + + public static int simpleFallthroughReturn(String value) { + switch (value) { + case "one": + case "two": + return 1; + default: + return 0; + } + } + + public static int noDefaultReturn(String value) { + switch (value) { + case "one": + return 1; + } + return 0; + } +} |
