• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Concurrency with Threads

 
Ranch Hand
Posts: 101
Netbeans IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Practice code from Bates&Sierra's book 4.a
*Create a class that starts one thread from an initialization block, that starts another thread from an inner class, and that starts a third thread from a constructor.

Isn't the statement a little misleading?






I don't think that this is what it is asked to do ¿Do I need at least three classes?
 
Joey Sanchez
Ranch Hand
Posts: 101
Netbeans IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This could be a better approach. From one thread we start the next and so on till the third one. Is it right like this?







 
Ranch Hand
Posts: 451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Joey Sanchez wrote:Practice code from Bates&Sierra's book 4.a
*Create a class that starts one thread from an initialization block, that starts another thread from an inner class, and that starts a third thread from a constructor.

Isn't the statement a little misleading?






I don't think that this is what it is asked to do ¿Do I need at least three classes?



I think this code :

should be

This Inside class starts a new thread in the constructor.



reply
    Bookmark Topic Watch Topic
  • New Topic