Advertisement
Guest User

Untitled

a guest
May 24th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. public class PassByRef {
  2.  
  3. public static void main(String[] args) {
  4.  
  5. int[] array = new int[3];
  6.  
  7. array[0] = 100;
  8.  
  9. modifyArray(array);
  10.  
  11. System.out.println( Arrays.toString(array) );
  12.  
  13. }
  14.  
  15. public static void modifyArray(int[] array) {
  16. array[0] = 5;
  17. }
  18.  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement