Friday, 27 September 2013

Thread start in main method

Thread start in main method

I am attempting to start a thread inside of the main method, but it will
not call the run method when i start the thread. I think it may have
something to do with starting a thread in a thread:
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++;
}
}

No comments:

Post a Comment