aspose file tools*
The moose likes Threads and Synchronization and the fly likes Thread adding doubles to an ArrayList in a different class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "Thread adding doubles to an ArrayList in a different class" Watch "Thread adding doubles to an ArrayList in a different class" New topic
Author

Thread adding doubles to an ArrayList in a different class

Gustavo Berndorfer Goldhardt
Greenhorn

Joined: Nov 16, 2009
Posts: 6
Hi all, this is my first time using Threads so I'm a bit confused. My problem: There is a class (lets call it The_Class), this class have an ArrayList of doubles. I need a Thread to add doubles in The_Class's list while The_Class continues executing the rest of its code... Is this possible? If yes, can someone show me how to do it?

Thank you very much!
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

well, start a new thread from a main thread and add values in to arraylist hence main thread keep on execute in different flow
Abimaran Kugathasan
Ranch Hand

Joined: Nov 04, 2009
Posts: 2066

Gustavo Berndorfer Goldhardt wrote:Hi all, this is my first time using Threads so I'm a bit confused. My problem: There is a class (lets call it The_Class), this class have an ArrayList of doubles. I need a Thread to add doubles in The_Class's list while The_Class continues executing the rest of its code... Is this possible? If yes, can someone show me how to do it?

Thank you very much!

Check whether it suits you or not...



|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
 
 
subject: Thread adding doubles to an ArrayList in a different class