I have two string arrays, and one is assign by the other. Why I assign one of them to null won't affect the other? As the console output , they both have the same address. Is't not the same with c++? here is my code:
String [] bikes = new String[5];
String [] largerBikes = new String[bikes.length + 5];
bikes = largerBikes;
System.out.println(bikes);
System.out.println(largerBikes);
largerBikes = null;
System.out.println(bikes);
System.out.println(largerBikes);