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. /* Name of the class has to be "Main" only if the class is public. */
  8. class Sample
  9. {int a,b;
  10. Sample()
  11. { a=1; b=2;
  12. System.out.println(a+"\t"+b);
  13. }
  14. Sample(int x)
  15. { this(10,20);
  16. a=b=x;
  17. System.out.println(a+"\t"+b);
  18. }
  19. Sample(int a,int b)
  20. { this();
  21. this.a=a;
  22. this.b=b;
  23. System.out.println(a+"\t"+b);
  24. }
  25. }
  26. class This2
  27. { public static void main(String args[])
  28. {
  29. Sample s1=new Sample (100);
  30. }
  31. }
  32.  
Success #stdin #stdout 0.14s 50344KB
stdin
Standard input is empty
stdout
1	2
10	20
100	100