avalon February 2016

Java typical usage of Void autoboxing type

What is the practical usage of Void reference type in java? How can it help me in practical programming?

Answers


Andy Turner February 2016

It is useful where you need to return some object type (e.g. if the return type is generic), but "return nothing" is the natural thing to do, e.g.

class MyCallable implements Callable<Void> {
  @Override public Void call() {
    // ... whatever
    return null;
  }
}

Post Status

Asked in February 2016
Viewed 1,404 times
Voted 10
Answered 1 times

Search




Leave an answer