fork download
  1. import java.util.*;
  2. import java.lang.*;
  3.  
  4. class Main
  5. {
  6. public static void changeInt(IntWrapper value)
  7. {
  8. value.setValue(55);
  9. }
  10.  
  11. public static void main (String[] args) {
  12. IntWrapper val = new IntWrapper();
  13. val.setValue(11);
  14. changeInt(val);
  15. System.out.println("Int value is:" + val.getValue());
  16. }
  17.  
  18. static class IntWrapper
  19. {
  20. private int value;
  21. public void setValue(int value) { this.value = value; }
  22. public int getValue() { return this.value; }
  23. }
  24. }
  25.  
Success #stdin #stdout 0.08s 212416KB
stdin
Standard input is empty
stdout
Int value is:55