Commit 05bef690 authored by duanledexianxianxian's avatar duanledexianxianxian 😁

init project

parent 6df3f402
...@@ -4,6 +4,7 @@ import java.util.concurrent.CountDownLatch; ...@@ -4,6 +4,7 @@ import java.util.concurrent.CountDownLatch;
/** /**
* Hello world! * Hello world!
* https://zhuanlan.zhihu.com/p/81626432
* *
* @author Administrator * @author Administrator
*/ */
...@@ -38,12 +39,12 @@ class Foo { ...@@ -38,12 +39,12 @@ class Foo {
} }
public static void main(String[] args) { public static void main(String[] args) {
Foo foo=new Foo(); Foo foo = new Foo();
// 创建3个线程 // 创建3个线程
Thread thread1 = new Thread(() -> { Thread thread1 = new Thread(() -> {
try { try {
foo.first(()->{ foo.first(() -> {
System.out.println("1"); System.out.println("1");
}); });
} catch (InterruptedException e) { } catch (InterruptedException e) {
...@@ -53,7 +54,7 @@ class Foo { ...@@ -53,7 +54,7 @@ class Foo {
Thread thread2 = new Thread(() -> { Thread thread2 = new Thread(() -> {
try { try {
foo.second(()->{ foo.second(() -> {
System.out.println("2"); System.out.println("2");
}); });
} catch (InterruptedException e) { } catch (InterruptedException e) {
...@@ -63,7 +64,7 @@ class Foo { ...@@ -63,7 +64,7 @@ class Foo {
Thread thread3 = new Thread(() -> { Thread thread3 = new Thread(() -> {
try { try {
foo.third(()->{ foo.third(() -> {
System.out.println("3"); System.out.println("3");
}); });
} catch (InterruptedException e) { } catch (InterruptedException e) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment