• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Quick question

 
Roger Chase
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Angela Poynton
Ranch Hand
Posts: 3143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
wrong forum Rodger .. i'm moving this to Programmer Certification Study
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic