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 test {
  9. int a;
  10. int b;
  11. test(int i, int j) {
  12. a = i;
  13. b = j;
  14. }
  15. void meth(test o) {
  16. o.a *= 2;
  17. o.b /= 2;
  18. }
  19. }
  20.  
  21. class Output{
  22. public static void main(String args[])
  23. {
  24. test obj = new test(10 , 20);
  25. obj.meth(obj);
  26. System.out.println(obj.a + " " + obj.b); }
  27. }
Success #stdin #stdout 0.05s 4386816KB
stdin
Standard input is empty
stdout
20 10