【发布时间】:2013-10-03 21:02:37
【问题描述】:
我试图在 main 方法中启动一个线程,但是当我启动线程时它不会调用 run 方法。我认为这可能与在线程中启动线程有关:
package com.audiack.theForest;
public class theForestThread implements Runnable {
private static int theBeginningTimes = 0;
private static TheBeginning theBeginning = new TheBeginning();
public static void main(String args[]){
Thread thread = new Thread();
thread.start();
}
@Override
public void run() {
theBeginning.start(theBeginningTimes);
theBeginningTimes++;
}
}
【问题讨论】:
标签: java multithreading main