📄 boxingexample2.java
字号:
package java2.F;
import static java.lang.System.*;
import java.util.*;
public class BoxingExample2
{
public static void main(String[] args)
{
Random rnd = new Random(currentTimeMillis());
List<Integer> nums = new ArrayList<Integer>();
for(int i=0; i<5; i++)
//nums.add(new Inetger(rnd.nextInt());
nums.add(rnd.nextInt());
Integer sum = new Integer(0);
//int iSum = 0;
//for(Integer i : nums)
// iSum += i.intValue());
//sum = new Integer(iSum);
for(int i : nums)
sum += i;
out.printf("sum%s is %d%n", nums.toString(), sum);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -