• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic