fork download
  1. public class Main{
  2. public static void main (String[] args){
  3. Document d = new Document("James");
  4. d.printOwner();
  5. }
  6. }
  7.  
  8. class Document{
  9. private String owner;
  10.  
  11. public Document(){
  12. this.owner = "none";
  13. }
  14.  
  15. public Document(String owner){
  16. this.owner = owner;
  17. }
  18.  
  19. public void printOwner(){
  20. System.out.println(owner);
  21. }
  22. }
Success #stdin #stdout 0.08s 52500KB
stdin
Standard input is empty
stdout
James