随笔分类 - 多线程
摘要:Thread与Runnable的区别(用三个窗口同时出售10张车票为例子) 运行代码 运行结果 分析 System.out.println("开始测试多线程");class MyThread extends Thread { private int ticket=10; private String
阅读全文
摘要:Thread使用run 和start 区别 结论:run()方法将作为当前调用线程本身的常规方法调用执行,并且不会发生多线程。 System.out.println("开始测试多线程");Thread thread1= new Thread() { @Override public void run
阅读全文
摘要:1、Thread Thread thread1= new Thread() { @Override public void run() { System.out.println(" Threading"); }};thread1.start(); Runnable (相当于Thread.run()那
阅读全文

浙公网安备 33010602011771号