I didn\'t even know this was doable, but I saw while perusing some code online a method with a signature like this:
public List read( ... )
>
I agree, it's odd.
I can see a use for it if you want to extend a generic class and return void from a method. I've bumped into a case were I want to use int
and had to use Integer
because java generics don't like primitive types.
public interface ObjectUserPool {
public E useObject(T o);
}
public class NonReturningObjectUserPool extends ObjectUserPool {
public Void useObject(Integer i);
}
I think this is what the java API is saying, though to be honest I can't really find a use for NonReturningObjectUserPool
.