Skip to content

Instantly share code, notes, and snippets.

@Sentient07
Last active November 2, 2015 13:58
Show Gist options
  • Save Sentient07/4c349fb3d6f567bf5bd5 to your computer and use it in GitHub Desktop.
Save Sentient07/4c349fb3d6f567bf5bd5 to your computer and use it in GitHub Desktop.
How pointers behave inside containers..
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