fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. interface zwierze {
  8. }
  9.  
  10. enum ssak implements zwierze {
  11. CZLOWIEK, DELFIN
  12. }
  13.  
  14. enum ptak implements zwierze {
  15. KURA, GOLOMP
  16. }
  17.  
  18. class test {
  19. private zwierze zwierze;
  20.  
  21. public test(zwierze zwierze) {
  22. this.zwierze = zwierze;
  23. }
  24.  
  25. public void print() {
  26. System.out.println(zwierze);
  27. }
  28. }
  29. /* Name of the class has to be "Main" only if the class is public. */
  30. class Ideone
  31. {
  32. public static void main (String[] args) throws java.lang.Exception
  33. {
  34. test kura = new test(ptak.KURA);
  35. kura.print();
  36.  
  37. test czlowiek = new test(ssak.CZLOWIEK);
  38. czlowiek.print();
  39. }
  40. }
Success #stdin #stdout 0.06s 380224KB
stdin
Standard input is empty
stdout
KURA
CZLOWIEK