Skip to content

Instantly share code, notes, and snippets.

@tksmaru
Created April 16, 2013 17:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tksmaru/5397619 to your computer and use it in GitHub Desktop.
Save tksmaru/5397619 to your computer and use it in GitHub Desktop.
オートボクシングは楽でいいですね
// JDK 1.4 style
List oldList = new ArrayList();
oldList.add(Integer.valueOf(1));
int oldNumber = ((Integer) oldList.get(0)).intValue();
// JDK 1.5 over
List<Integer> newList = new ArrayList<Integer>();
newList.add(1);
int modernNumber = newList.get(0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment