EasyThread:轻松编写多线程代码。 您可以在一个类中编写多个线程代码

时间:2021-06-20 10:01:42
【文件属性】:
文件名称:EasyThread:轻松编写多线程代码。 您可以在一个类中编写多个线程代码
文件大小:10KB
文件格式:ZIP
更新时间:2021-06-20 10:01:42
Java 可以很方便地在一个类里面写多个线程的代码 #Download #Example 一个简单的例子 /** * 一只猫和一只狗隔一段时间叫一声 */ public class SimpleExample { @Threads public void dog() throws InterruptedException { for (int i = 0; i < 5; i++) { System.out.println("dog bark"); Thread.sleep(400L); } } @Threads public void cat() throws InterruptedException { for (int i = 0; i < 5; i++) { System.out.println("cat mew
【文件预览】:
EasyThread-master
----.gitattributes(378B)
----src()
--------org()
----example()
--------LinkedBlockingQueueTest.java(1KB)
--------SimpleExample.java(608B)
----README.md(2KB)
----.gitignore(574B)

网友评论