
源码解析
wwwwen_t
爱学习
展开
-
Thread (源码解析)
publicclass Thread implements Runnable { /* Make sure registerNatives is the first thing <clinit> does. */ private static native void registerNatives(); static { registerNatives(); }。。。}创建一个新的执行线程有两种方法。一个是将一个类声明为Threa..原创 2021-09-01 20:39:33 · 296 阅读 · 0 评论 -
Interface Runnable(源码解析)
源码:@FunctionalInterfacepublic interface Runnable {/** *当一个实现Runnable接口的对象被使用则创建一个线程 *启动这个线程则会运行run()方法 */ public abstract void run();}@FunctionalInterface(只有一个抽象方法的接口)代码测试:public class MyRunnable implements Runnable{ @Override .原创 2021-08-31 10:39:29 · 264 阅读 · 0 评论