下面代码中包含一些自动装箱和自动拆箱的行,其中自动装箱的行有: 1. public class UseBoxing{ 2. boolean go(Integer i){ 3. Boolean ifSo = true; 4. Short s = 300; 5. if(ifSo){ 6. System.out.println(++s); 7. } 8. return !ifSo; 9. } 10. public static void main(String[] args){ 11. UseBoxing ub = new UseBoxing(); 12. ub.go(20); 13. } 14. }
下面代码中包含一些自动装箱和自动拆箱的行,其中自动装箱的行有: 1. public class UseBoxing{ 2. boolean go(Integer i){ 3. Boolean ifSo = true; 4. Short s = 300; 5. if(ifSo){ 6. System.out.println(++s); 7. } 8. return !ifSo; 9. } 10. public static void main(String[] args){ 11. UseBoxing ub = new UseBoxing(); 12. ub.go(20); 13. } 14. }
1