File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

dont call them threads..they are hard to break:)

 
Harvinder Singh
Ranch Hand
Posts: 90
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tuesday,2/17/2004 10:57:45 PM
Hi,
May I know why the second thread prints A and not B?
Let me make a wild guess first.When I pass a runnable instance to the thread class it is registered with the Thread scheduler but when I pass to the subclass of A it is not.
 
Richard Quist
Ranch Hand
Posts: 96
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Harvinder Singh:
Tuesday,2/17/2004 10:57:45 PM
Hi,
May I know why the second thread prints A and not B?
Let me make a wild guess first.When I pass a runnable instance to the thread class it is registered with the Thread scheduler but when I pass to the subclass of A it is not.


The A.run() method overrides the Thread.run()....add a call to super.run() before or after your System.out.print("A"); statement
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic