fork(2) download
  1. enum Enum1
  2. {
  3. COND_1,
  4. COND_2
  5. }
  6. enum EnumA
  7. {
  8. COND_A,
  9. COND_B
  10. }
  11.  
  12. class Ideone
  13. {
  14. public static void main (String[] args) throws java.lang.Exception
  15. {
  16. final Enum1 var1 = Enum1.COND_2;
  17. final EnumA varA = EnumA.COND_B;
  18.  
  19. class Tester {
  20. boolean t(Enum1 v1, EnumA vA) {
  21. return var1 == v1 && varA == vA;
  22. }
  23. };
  24.  
  25. Tester tes = new Tester();
  26.  
  27. if (tes.t(Enum1.COND_1, EnumA.COND_A)) {
  28. System.out.println("W");
  29. } else if (tes.t(Enum1.COND_1, EnumA.COND_B)) {
  30. System.out.println("X");
  31. } else if (tes.t(Enum1.COND_2, EnumA.COND_A)) {
  32. System.out.println("Y");
  33. } else if (tes.t(Enum1.COND_2, EnumA.COND_B)) {
  34. System.out.println("Z");
  35. }
  36.  
  37. }
  38. }
Success #stdin #stdout 0.04s 711168KB
stdin
Standard input is empty
stdout
Z