检索规则说明:AND代表“并且”;OR代表“或者”;NOT代表“不包含”;(注意必须大写,运算符两边需空一格)
检 索 范 例 :范例一: (K=图书馆学 OR K=情报学) AND A=范并思 范例二:J=计算机应用与软件 AND (U=C++ OR U=Basic) NOT M=Visual
作 者:谢文兰[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[自动化与计算机技术—计算机系统结构]
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在链接到云南高校图书馆文献保障联盟下载...
云南高校图书馆联盟文献共享服务平台 版权所有©
您的IP:216.73.216.75