4月14日,TestJoin,每日20行。
来源:互联网 发布:淘宝客户评价在哪里 编辑:程序博客网 时间:2024/06/06 04:17
import java.util.*;class Adder extends Thread{ int[] datas = null; public int total = 0; Adder(int[] _datas){ datas = _datas; } public void run(){ int sum = 0; for(int i = 0; i < datas.length; i++){ sum += datas[i]; } total = sum; }};public class TestJoin { public static void main(String args[]) { Random rd = new Random(); int[] datas = new int[10000]; for(int i = 0; i < 10000; i++){ datas[i] = rd.nextInt(Integer.MAX_VALUE); } Adder a = new Adder(datas); a.start(); try{ a.join(); } catch(InterruptedException it){} System.out.println(a.total); }}
实现 10 000 个随机数相加。
0 0
- 4月14日,TestJoin,每日20行。
- 6月14日,每日20行。
- 6月4日,每日20行。
- 3月14日,Menu_Item,每日20行。
- 4月20日,TestVector,每日20行。
- 4月4日,Decode,每日20行。
- 3月4日,simple_window,每日20行。
- 4月1日,StringEqualTest,每日20行。
- 4月2日,StringEqualTest1,每日20行。
- 4月3日,CharCode,每日20行。
- 4月5日,StringBufferPass,每日20行。
- 4月6日,StringBufferModify,每日20行。
- 4月7日,RemoveHZ,每日20行。
- 4月8日,DemogetProperties,每日20行。
- 4月9日,GetCurrentTime,每日20行。
- 4月10日,MyThread,每日20行。
- 4月11日,MyThread,每日20行。
- 4月12日,TestMyThread,每日20行。
- c语言之多级指针的应用
- 数据库知识点三
- LeetCode 125 Valid Palindrome
- spak 性能优化
- myEclipse使用技巧
- 4月14日,TestJoin,每日20行。
- Spring的Ioc容器简单实现
- 24点游戏(java)
- Error:(1, 0) Plugin with id 'com.android.application' not found
- Android界面布局及其内属性
- GDOI2017模拟第一轮总结
- 第一个Python程序
- nodejs fs模块
- pandas 把数据写入txt文件每行固定写入一定数量的值