java可以开启线程吗?

 答案:

不可以;

原因:

java运行在虚拟机上,无法直接操作硬件,在start方法中调用了本地方法start0,通过C++操作

底层源码:
public synchronized void start() {
/**
* This method is not invoked for the main method thread or "system"
* group threads created/set up by the VM. Any new functionality added
* to this method in the future may have to also be added to the VM.
*
* A zero status value corresponds to state "NEW".
*/
if (threadStatus != 0)
throw new IllegalThread

java可以开启线程吗?最先出现在Python成神之路

版权声明:
作者:Zad
链接:https://www.techfm.club/p/22048.html
来源:TechFM
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>