aspose file tools
The moose likes Threads and Synchronization and the fly likes Callable collection methods Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Threads and Synchronization
Reply Bookmark "Callable collection methods" Watch "Callable collection methods" New topic
Author

Callable collection methods

meeta gaur
Ranch Hand

Joined: Dec 05, 2012
Posts: 226


1

Why does it always choose output 1 ?


OCAJP
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 3860
    
    1

You're adding the same CallableCollection 6times to a HashSet. The last 5 times have no effect, because the set won't allow duplicates.

Also, the first call to call for any CallableCollection will return 1. And you only call it once on any CallableCollection.
meeta gaur
Ranch Hand

Joined: Dec 05, 2012
Posts: 226


six

Thanks, i made some changes, now it gives me different output each time.
meeta gaur
Ranch Hand

Joined: Dec 05, 2012
Posts: 226

 
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: Callable collection methods
 
Similar Threads
Set question
Errata ?
Generic
using Sets
for loop