aspose file tools
The moose likes Threads and Synchronization and the fly likes java.util.concurrent.Future<capture#293 of ?> Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Reply Bookmark "java.util.concurrent.Future<capture#293 of ?>" Watch "java.util.concurrent.Future<capture#293 of ?>" New topic
Author

java.util.concurrent.Future<capture#293 of ?>

Steven Rodeo
Ranch Hand

Joined: Mar 06, 2008
Posts: 69

Apologies if this may be too basic, not sure even if this question belongs here, but when I am trying to submit a Runnable Task, I am not sure what should be the return value.

The following code snippet, gives the following error.




found : java.util.concurrent.Future<capture#293 of ?>
required: java.util.concurrent.Future<java.lang.Runnable>
Future<Runnable> ldkdl = def.submit(new runnables(3838));
1 error


-SM
Ireneusz Kordal
Ranch Hand

Joined: Jun 21, 2008
Posts: 423
This compiles:


Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 14606


Basically, the generic type of the future object is the type to be returned from the callable (or runnable). In the case of runnable, which doesn't have a return type, you can either use the submit() method that specifies the type, or assign it to an unknown type.... ie. Future<?>.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
 
subject: java.util.concurrent.Future<capture#293 of ?>
 
Threads others viewed
Hibernate second level caching
scriptlet processing query in JSP
parallelism in a for loop and using java 5 concurrency
Generics error, can not understand
Error with the makefile in eclipse
developer file tools