Java Inner Thread12/11/10 PermalinkSometimes it's more convenient to run a thread inside the current code flow. Here's how to do this:
public void someMethod(){
Thread t = new Thread(){
public void run(){
try{
//do stuff
}catch(Throwable t){
t.printStackTrace();
}
}
};
t.start();
}
|
|