I know this is strange, but i have a simple syntax question. Right now I'm working with a thread in the following format. The use of "setDaemon" in the run function does not work, as you apparently must set Daemon before you start the thread.
new Thread()
{
@Override
public void run()
{
setDaemon(true); // This is what is causing the error.
while(true)
{
//Update loop stuff
}
}
}.start();
Is it possible to do something like what is below, where i move the set daemon near the "start()". However to do this will try to start void.
new Thread()
{
@Override
public void run()
{
while(true)
{
//Update loop stuff
}
}
}.setDaemon(true).start();
So how would I do something so that I can setDaemon(true), and also start the thread, while maintaing this kind of formatting.
I'm sorry if this is a duplicate thread, but i've been unable to find anything talking about what I want to do.