fork download
  1. class Main {
  2. public static void main(String[] args) {
  3. int x = 2;
  4. int y = 2;
  5. switch(x) {
  6. case 1: break;
  7. case y: break;
  8. }
  9. }
  10. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
1
2
10
42
11
compilation info
Main.java:7: error: constant expression required
            case y: break;
                 ^
1 error
stdout

Standard output is empty