Skip to content

Commit 2d83505

Browse files
author
chenzhuo
committed
更新low比代码
1 parent 893fc9c commit 2d83505

4 files changed

Lines changed: 58 additions & 6 deletions

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package com.concurrent.threapoollearn;
2+
3+
import java.util.concurrent.ExecutorService;
4+
import java.util.concurrent.Executors;
5+
6+
/**
7+
* @author by chenzhuo
8+
* @Description 线程池测试2
9+
* @Date 2019/6/12 20:34
10+
**/
11+
public class TheadPoolTestTwo {
12+
13+
public static void main(String[] args) {
14+
ExecutorService executors = Executors.newCachedThreadPool();
15+
executors.submit(new Run());
16+
}
17+
18+
19+
public static class Run implements Runnable {
20+
21+
@Override
22+
public void run() {
23+
try {
24+
int count = 0;
25+
while (true) {
26+
count++;
27+
System.out.println(count);
28+
if (count == 10) {
29+
System.out.println(1 / 0);
30+
}
31+
}
32+
} catch (Exception e) {
33+
System.err.println("111");
34+
}
35+
System.err.println("222");
36+
}
37+
}
38+
}

src/main/java/com/concurrent/threaPoolLearn/ThreadPoolTest.java renamed to src/main/java/com/concurrent/threapoollearn/ThreadPoolTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.concurrent.threaPoolLearn;
1+
package com.concurrent.threapoollearn;
22

33
import java.util.concurrent.*;
44
import java.util.concurrent.atomic.AtomicInteger;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/**
2+
* @Description 数据结构相关
3+
* 1.线性结构
4+
* a.数组
5+
* b.arrayList
6+
* c.linkList
7+
* d.queue
8+
* 1.单向队列
9+
* 2.循环单向队列
10+
* 3.双向队列
11+
* 4.循环双想队列
12+
*
13+
* @Date 2019/5/31 14:57
14+
* @author by chenzhuo
15+
**/
16+
package com.datastructure;
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package com.match;
22

3-
import com.basics.ClassLoaderTest.classPathTest.ClassLoaderTest;
4-
import com.basics.ClassLoaderTest.classPathTest.ObjectHello;
53

64
/**
75
* @ClassName: ClassLoaderMain
@@ -13,12 +11,12 @@ public class ClassLoaderMain {
1311

1412
public static void main(String[] args) throws ClassNotFoundException, IllegalAccessException, InstantiationException {
1513

16-
ClassLoaderTest loadClass = (ClassLoaderTest) ConextClassLoadTest.getThreadConextClassLoad(Thread.currentThread());
14+
com.basics.classloadertest.classPathTest.ClassLoaderTest loadClass = (com.basics.classloadertest.classPathTest.ClassLoaderTest) ConextClassLoadTest.getThreadConextClassLoad(Thread.currentThread());
1715

1816
Class<?> testClass = (Class<?>) loadClass.findClass("com.basics.ClassLoaderTest.classPathTest.ObjectHello");
1917

20-
ObjectHello newInstance = (ObjectHello) testClass.newInstance();
21-
ObjectHello testClass1 = new ObjectHello();
18+
com.basics.classloadertest.classPathTest.ObjectHello newInstance = (com.basics.classloadertest.classPathTest.ObjectHello) testClass.newInstance();
19+
com.basics.classloadertest.classPathTest.ObjectHello testClass1 = new com.basics.classloadertest.classPathTest.ObjectHello();
2220

2321
}
2422
}

0 commit comments

Comments
 (0)