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
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Reply 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%|
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Thread adding doubles to an ArrayList in a different class
 
Similar Threads
adding it all up
How to find the average of arraylist containing database values
Parsing a text file to an arraylist
Collections API
Collection size incosistency