Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. package passByReference;
  2.  
  3. public class blah {
  4. public static void main(String[] args) {
  5. passByReference value = new passByReference(2);
  6. System.out.println(value.value);
  7. changeValueByReference(value);
  8. System.out.println(value.value);
  9. }
  10.  
  11.  
  12. private static void changeValueByReference(passByReference val) {
  13. val.value = 5;
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement