fork download
  1. class Test {
  2.  
  3. enum SomeEnum {
  4. VAL1(42, "hui"),
  5. VAL2(100500, "pizda"),
  6. VAL3(7, "djigurda");
  7.  
  8. private final int id;
  9. private final String anotherShit;
  10.  
  11. private SomeEnum(int id, String anotherShit) {
  12. this.id = id;
  13. this.anotherShit = anotherShit;
  14. }
  15.  
  16. public int id() {
  17. return id;
  18. }
  19. public String anotherShit() {
  20. return anotherShit;
  21. }
  22. }
  23.  
  24. public static void main(String[] args) {
  25. for (SomeEnum e : SomeEnum.values()) {
  26. System.out.println(e.toString() + " " + e.ordinal() + " " +
  27. e.id() + " " + e.anotherShit());
  28. }
  29. }
  30.  
  31. }
Success #stdin #stdout 0.08s 380224KB
stdin
Standard input is empty
stdout
VAL1 0 42 hui
VAL2 1 100500 pizda
VAL3 2 7 djigurda