Skip to content

Commit f530fde

Browse files
committed
🎨 0.0.2 描述:优化部分代码,提供打包说明
1 parent 0a0bdd1 commit f530fde

File tree

2 files changed

+78
-2
lines changed

2 files changed

+78
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ Hope-boot的诞生离不开下面这些项目(取之开源,用之开源)
155155
- [hope-boot使用GPL-v3.0协议开源](https://github.com/hope-for/hope-boot/blob/master/LICENSE)
156156
- [低调小熊猫QQ群](https://jq.qq.com/?_wv=1027&k=5y4H7Nz)
157157
- [低调小熊猫Telegram群](https://t.me/joinchat/LSsyBxVKLGEkF5MtIhg6TQ)
158-
- [我的Gitee链接](https://gitee.com/java-aodeng/hope)
159-
- [我的Github链接](https://github.com/java-aodeng/hope)
158+
- [我的Gitee链接](https://gitee.com/java-aodeng)
159+
- [我的Github链接](https://github.com/java-aodeng)
160160
- [我的开源组织(欢迎志同道合的朋友加入)](https://github.com/hope-for)
161161
- 联系我的邮箱:java@aodeng.cc 申请加入hope-for组织也是发送到该邮箱哦,记得带上你的GitHub账号
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
package com.hope.test;
2+
3+
import java.util.concurrent.ArrayBlockingQueue;
4+
import java.util.concurrent.ThreadPoolExecutor;
5+
import java.util.concurrent.TimeUnit;
6+
7+
/**
8+
* @author:aodeng(低调小熊猫)
9+
* @blog:(https://aodeng.cc)
10+
* @Description: TODO
11+
* @Date: 19-5-8
12+
**/
13+
public class TestMain {
14+
public static void main(String[] args) {
15+
//构造一个线程池
16+
ThreadPoolExecutor threadPool=new ThreadPoolExecutor(
17+
1,1,1, TimeUnit.SECONDS,
18+
new ArrayBlockingQueue<Runnable>(1),
19+
new ThreadPoolExecutor.DiscardPolicy()
20+
);
21+
threadPool.execute(new Runnable() {
22+
@Override
23+
public void run() {
24+
System.out.println("a");
25+
for (int a =0;a<10;a++){
26+
System.out.println(a+=1);
27+
}
28+
System.out.println("aa");
29+
}
30+
});
31+
threadPool.execute(new Runnable() {
32+
@Override
33+
public void run() {
34+
System.out.println("b");
35+
for (int a =0;a<10;a++){
36+
System.out.println(a+=1);
37+
}
38+
System.out.println("bb");
39+
}
40+
});
41+
threadPool.execute(new Runnable() {
42+
@Override
43+
public void run() {
44+
System.out.println("c");
45+
for (int a =0;a<10;a++){
46+
System.out.println(a+=1);
47+
}
48+
System.out.println("cc");
49+
}
50+
});
51+
threadPool.execute(new Runnable() {
52+
@Override
53+
public void run() {
54+
System.out.println("d");
55+
int [] temp =new int[10];
56+
for (int a =0;a<10;a++){
57+
temp[a]=a+1;
58+
}
59+
for (int t:temp){
60+
System.out.println(t);
61+
}
62+
System.out.println("dd");
63+
}
64+
});
65+
threadPool.execute(new Runnable() {
66+
@Override
67+
public void run() {
68+
System.out.println("e");
69+
for (int a =0;a<10;a++){
70+
System.out.println(a+=1);
71+
}
72+
System.out.println("ee");
73+
}
74+
});
75+
}
76+
}

0 commit comments

Comments
 (0)