javaclass

Changeset

63:2c8239b4e8ad
2004-11-19 Paul Boddie raw files shortlog changelog graph Added a test of switch statements.
tests/SwitchTest.java (file)
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/tests/SwitchTest.java	Fri Nov 19 15:45:43 2004 +0100
     1.3 @@ -0,0 +1,21 @@
     1.4 +public class SwitchTest {
     1.5 +
     1.6 +    public int test(int x) {
     1.7 +        switch (x) {
     1.8 +            case 0:
     1.9 +
    1.10 +            case 1:
    1.11 +            x = x + 10;
    1.12 +            break;
    1.13 +
    1.14 +            case 2:
    1.15 +            x = x + 20;
    1.16 +            break;
    1.17 +
    1.18 +            default:
    1.19 +            break;
    1.20 +        }
    1.21 +
    1.22 +        return x;
    1.23 +    }
    1.24 +}