Skip to content

Instantly share code, notes, and snippets.

@danmux
Created November 24, 2015 16:38
Show Gist options
  • Save danmux/d092fd944888bb1d20f6 to your computer and use it in GitHub Desktop.
Save danmux/d092fd944888bb1d20f6 to your computer and use it in GitHub Desktop.
import java.util.*;
class Temp {
public static void main(String[] args) {
// this works....
ArrayList<ArrayList<String>> outer = new ArrayList<ArrayList<String>>();
ArrayList<String> inner = new ArrayList<String>();
outer.add(inner);
inner.add("hi terra");
System.out.println(outer.get(0).get(0));
// so does this....
outer = new ArrayList<ArrayList<String>>();
inner = new ArrayList<String>();
inner.add("hi boobs");
outer.add(inner);
System.out.println(outer.get(0).get(0));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment