I know the method signature is including method name and its parameter list.
But how about throws Exception
?
public List<ServiceStatusVo> listServiceStatuses() throws RetrieverException {
...
return list;
}
If it's not included then why I cannot pass in the following lambda:
() -> listServiceStatuses()
but I can pass in
() -> {
try {
return listServiceStatuses();
} catch (RetrieverException e) {
}
}
And also I can throw it out again
() -> {
try {
return listServiceStatuses();
} catch (RetrieverException e) {
throw e;
}
}
I know the Supplier<T>
functional interface, that's what really confusing me if throws is not part of the method signature.
Thanks for the help.