Skip to content

Instantly share code, notes, and snippets.

@Harshal96
Created July 19, 2019 04:01
Show Gist options
  • Select an option

  • Save Harshal96/5be3be011537d06c9a017b1656249166 to your computer and use it in GitHub Desktop.

Select an option

Save Harshal96/5be3be011537d06c9a017b1656249166 to your computer and use it in GitHub Desktop.
// option 1
// this?
List<String> list = new ArrayList<String>() {{
add("Hello");
add("World!");
}};
// option 2
// or this?
List<String> l = new ArrayList<String>();
l.add("Hello");
l.add("World!");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment