这是两种开发中常用的线程使用方法,匿名对象调用即可,很简单,掌握即可
<span style="font-size:18px;">class ThreadDemo { public static void main(String[] args) { new Thread() { public void run() { //coding here } }.start(); Runnable r = new Runnable() { public void run() { //coding here } }; new Thread(r).start(); } } </span>
原文地址:http://blog.csdn.net/seraphme1/article/details/45586093