fork download
  1. class test {
  2.  
  3.  
  4. int a;
  5.  
  6.  
  7.  
  8. int b;
  9.  
  10. test(int i, int j) {
  11.  
  12. a = i;
  13.  
  14.  
  15.  
  16. b = j;
  17.  
  18. }
  19.  
  20. void meth(test o) {
  21.  
  22. o.a *= 2;
  23.  
  24. o.b /= 2;
  25.  
  26. }
  27.  
  28. }
  29.  
  30. class Output{
  31.  
  32. public static void main(String args[])
  33.  
  34. {
  35.  
  36. test obj = new test(10, 20);
  37.  
  38. obj.meth(obj);
  39.  
  40. System.out.println(obj.a + " " + obj.b); }
  41.  
  42. }
Success #stdin #stdout 0.15s 55452KB
stdin
Standard input is empty
stdout
20 10