How to use Callable with void return type?

前端 未结 3 650
时光取名叫无心
时光取名叫无心 2021-02-02 05:21

I am working on a project in which I have multiple interface and two Implementations classes which needs to implement these two interfaces.

Suppose my first Interface is

3条回答
  •  日久生厌
    2021-02-02 05:52

    Why would you need a void for running something in Parallel? For one, if you don't need the return value, you can simply return null.

    To make something parallel you need to use threading/scheduling. I would personally recommend avoiding Callables, and using Runnables instead (and hey, no return value).

提交回复
热议问题