Guest User

Untitled

a guest
Mar 17th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.48 KB | None | 0 0
  1. package net.dharmaraj;
  2.  
  3. class Value {
  4.  
  5.           public int i = 15;
  6. }
  7.  
  8. public
  9. class Test {
  10.  
  11.  
  12. public static void main(String argv[]) {
  13.  
  14. Test t = new Test();
  15. t.first();
  16.  
  17. }
  18.  
  19. public void first() {
  20.     int i = 5;
  21.   Value v = new Value();
  22.    v.i = 25;
  23.    second(v, i);
  24.   System.out.println(v.i);
  25. }
  26.  
  27. public void second(Value v, int i) {
  28.         i = 0;
  29.         v.i = 20;
  30.        Value val = new Value();
  31.        v = val;
  32.        System.out.println(v.i + " " + i);
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment