Last active
November 2, 2015 13:58
-
-
Save Sentient07/4c349fb3d6f567bf5bd5 to your computer and use it in GitHub Desktop.
How pointers behave inside containers..
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
public class Hello{ | |
public static void main(String []args){ | |
System.out.println("Hello World"); | |
ArrayList<String> a1 = new ArrayList<String>(); | |
ArrayList<String> b1 = a1; | |
b1.add("hello"); | |
b1.add("yo!"); | |
System.out.println(a1.toString()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment