Darano

Reference

Nov 8th, 2018
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.37 KB | None | 0 0
  1.  
  2. public class Main {
  3.  
  4.     public static void main(String args[]) {
  5.         int[] a = new int[10];
  6.         int[] b = null;
  7.  
  8.         for(int i=0; i < a.length; i++)
  9.             a[i] = i;
  10.  
  11.         b = a;
  12.  
  13.         System.out.println("Before setting to a5 to 999, b5 = "+b[5]);
  14.         a[5] = 999;
  15.         System.out.println("After setting to a5 to 999, b5 = "+b[5]);
  16.        
  17.     }
  18.  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment