浅谈JAVA中多线程的实现  

A Brief Introduction of the Multi-threading Implementation in JAVA

在线阅读下载全文

作  者:谢文兰[1] 

机构地区:[1]广东培正学院计算机科学与工程系

出  处:《广东培正学院论丛》2017年第1期59-62,共4页The Journal of Guangdong Peizheng College

摘  要:介绍了在JAVA 中实现多线程的两种办法.第一种是通过继承Thread类.第二种是通 过实现Runnable接口.并且用这两种办法模拟了兔子和乌龟同时赛跑,以及乌龟最终获得胜利的过 程和结果.人们会在生活中遇到多种多线程的情况.多线程的并发执行可以提高工作效率.Concurrent execution of Multi-threading can improve work efficiency. People will encounter a variety of multi-threading in daily life. This paper introduces two ways in which multi -threading is implemented in JAVA. The first way is by the inheritance of the Thread class. The second way is by implementing the Runnable interface. Also in this paper how the hare and the tortoise begin at the same time in the race and the tortoise finally wins the game are simulated by the use the of the two ways.

关 键 词:多线程 Thread类 Runnable接口 

分 类 号:TP37[自动化与计算机技术—计算机系统结构]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象