Shivam Joshi wrote:
Why is there a compilation error when calling process() .
Hate to point out the obvious, but doesn't the compiler message explain it? You are not handling a checked exception. Or to be more specific, you are not handling a declared exception, which also include checked exceptions.
... and for the followup question... keep in mind that the compiler only works with references here, it doesn't know that the method (for the instance) doesn't throw a checked exception.