I have a quick question about threads:
Look at the following segment of code for executing a
thread:
1)class MyThread immplements Runnable
..{ Lots of code}...
30)MyThread mt = new MyThread
31)Thread newThrd = new Thread(mt);
Obviously this is proper....my question is, is the following ALSO proper(i.e. Will it compile & not though any exceptions?)
No line 30...INSTEAD:
Thread newThrd = new Thread(new MyThread)
Can you do that?
Thanks!