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. enum Felony{
  8. Theft,
  9. Robbery
  10. }
  11.  
  12. class Prisoner{
  13. private String name;
  14. private Felony felony;
  15.  
  16. public Prisoner(String name, Felony felony){
  17. this.name = name;
  18. this.felony = felony;
  19. }
  20.  
  21. public void Show(){
  22. System.out.println("Name: " + this.name + ", Felony: " + this.felony);
  23. }
  24. }
  25.  
  26. class Ideone
  27. {
  28. public static void main (String[] args) throws java.lang.Exception
  29. {
  30. Prisoner prisoner = new Prisoner("Garry", Felony.Robbery);
  31. prisoner.Show();
  32. }
  33. }
Success #stdin #stdout 0.1s 320512KB
stdin
Standard input is empty
stdout
Name: Garry, Felony: Robbery