how would you implement this java interface in kot...
# getting-started
p
how would you implement this java interface in kotlin if you want the output type to be equivalent of
void
?
Copy code
public interface RequestHandler<I, O> {
    public O handleRequest(I input, Context context);
}
n
I use
Nothing?
as a type, then you can pass
null
as an argument.
Copy code
class MyClass: RequestHandler<I, Nothing?> {
   fun handleRequest(input: I, context: Context): Nothing? = null
}
Something like that.
a
Unit
if the method is expected to return