Can a method present in the RequestContext method return void?
If my RequestContext looks like this,
@Service( value = PersonUtil.class, locator = PersonLocator.class )
public interface PersonRequest extends RequestContext
{
Request<void> testMethod( Long id );
......
}
I am getting this error:
Multiple markers at this line
– Return type for the method is missing
– Syntax error on token “void”, Dimensions expected after
Can we not create a method with return type void? If not, why is it so?
Thanks in advance.
voidis just like primitive types likeintorboolean, you can’t use it as a type parameter.And just like you’d use
Integerinstead ofint, you’ll useVoidhere (java.lang.Void)