翻译Thread

public class

Thread

extends Object
implements Runnable
java.lang.Object
   ↳java.lang.Thread
Known Direct Subclasses

Class Overview


A Thread is a concurrent unit of execution. It has its own call stack for methods being invoked, their arguments and local variables. Each application has at least one thread running when it is started, the main thread, in the main ThreadGroup. The runtime keeps its own threads in the system thread group.

There are two ways to execute code in a new thread. You can either subclass Thread and overriding its run() method, or construct a new Thread and pass a Runnable to the constructor. In either case, the start() method must be called to actually execute the new Thread.

Each Thread has an integer priority that affect how the thread is scheduled by the OS. A new thread. A thread's priority can be set using the setPriority(int) method.

译文:

一个线程是并发的。它有自己的调用堆栈的方法被调用,他们的参数和本地变量。每一个应用程序有最少一个线程运行当他被开启时,主线程,在主线程组中。运行时系统中保持自己的线程组。

有两种途径在心的线程中执行代码。你既可以用子类线程和覆盖它的run()方法,也可以建造一个新线程和Runnable传递给构造函数。在这两种情况下,start()方法必须调用实际执行新的线程。

每一个线程有一个整数优先影响操作系统线程。一个新的线程继承了父类的优先级。一个线程的优先级可以设置使用setPriority(int)方法。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值