Created
April 16, 2013 17:03
-
-
Save tksmaru/5397619 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
// 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