| 1. package myrefactor ; 2. public class Jdk5 3. { 4. … 5. public static void autoBoxingPreliminary(Integer intObject) 6. { 7. System.out.println(intObject) ; 8. } 9. 10. public static void autoBoxingRefactoring() 11. { 12. autoBoxingPreliminary(new Integer(8)) ; 13. } 14. … 15. } |
| 1. package myrefactor ; 2. public class Jdk5 3. { 4. … 5. public static void autoBoxingPreliminary(Integer intObject) 6. { 7. System.out.println(intObject) ; 8. } 9. 10. public static void autoBoxingRefactoring() 11. { 12. autoBoxingPreliminary(8) ; 13. } 14. … 15. } |
| 1. public static void genericsArrayList() 2. { 3. List list = new ArrayList() ; 4. list.add(0 , new Integer(23)) ; 5. int total = ( (Integer) list.get(0)).intValue() ; 6. System.out.println(total) ; 7. } |

| 1. public static void genericsArrayList() 2. { 3. List<Integer> list = new ArrayList<Integer> () ; 4. list.add(0 , new Integer(23)) ; 5. int total = (list.get(0)).intValue() ; 6. System.out.println(total) ; 7. } |