get新技能是需要付出行动的,即使看得再多也还是要动手试一试。今天图老师小编跟大家分享的是JBuilder2005实现重构之升级到JDK5.02,一起来学习了解下吧!
【 tulaoshi.com - 编程语言 】
3、自动装/拆箱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. Listlist = new ArrayList() ;
4. list.add(0 , new Integer(23)) ;
5. int total = (list.get(0)).intValue() ;
6. System.out.println(total) ;
7. }
来源:http://www.tulaoshi.com/n/20160219/1618525.html
看过《JBuilder2005实现重构之升级到JDK5.02》的人还看了以下文章 更多>>