Created
July 19, 2019 04:01
-
-
Save Harshal96/5be3be011537d06c9a017b1656249166 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // 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