aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Concurrency with Threads Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Concurrency with Threads" Watch "Concurrency with Threads" New topic
Author

Concurrency with Threads

Joey Sanchez
Ranch Hand

Joined: Jun 23, 2011
Posts: 86

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

Joined: Jun 23, 2011
Posts: 86

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?







Helen Ma
Ranch Hand

Joined: Nov 01, 2011
Posts: 451
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.



 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Concurrency with Threads