Created
August 4, 2018 14:50
-
-
Save samfcmc/cdb026ab0439a1a91652a114cbfb87f3 to your computer and use it in GitHub Desktop.
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
// Passing the capacity to the array list... Remember? :) | |
List<String> list = new ArrayList(2); | |
list.add("Test"); // This is right | |
list.add(2) // Compile time error... This list only accepts string elements |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment