You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

NonConstants.java 594B

1234567891011121314151617181920
  1. public class NonConstants {
  2. private static final int A = 1;
  3. private static final int B = 2;
  4. private static final int C = 3;
  5. private static final int D = 4;
  6. private static final int E = 5;
  7. public static void main(String[] args) {
  8. NonConstants nc = new NonConstants();
  9. int x = 10;
  10. switch(x) {
  11. case (NonConstants).A: break;
  12. case ((NonConstants)null).B: break; //ERR
  13. case (nc).C: break; //ERR
  14. case nc.D: break; //ERR
  15. case ((((NonConstants)))).E: break;
  16. }
  17. }
  18. }