Skip to content

Instantly share code, notes, and snippets.

@ChimeraCoder
Created September 27, 2012 04:41
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ChimeraCoder/3792197 to your computer and use it in GitHub Desktop.
Java int vs Integer Example
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