Created
September 27, 2012 04:41
-
-
Save ChimeraCoder/3792197 to your computer and use it in GitHub Desktop.
Java int vs Integer Example
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
ArrayList<Integer> someNumbers= new ArrayList<Integer>(); | |
ArrayList<int> luckyNumbers= new ArrayList<int>(); | |
//This will cause a compiletime error | |
// | |
JavaExample.java:23: unexpected type | |
found : int | |
required: reference | |
ArrayList<int> luckyNumbers= new ArrayList<int>(); | |
^ | |
JavaExample.java:23: unexpected type | |
found : int | |
required: reference | |
ArrayList<int> luckyNumbers= new ArrayList<int>(); | |
^ | |
2 errors |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment