I have created my own type of exception and want to implement it in a method. As of now I have written it in the following way, and it works.
public Worker remov
I'm not going to comment on whether or not to use checked vs unchecked exceptions as that will provoke a monster debate.
If you create a checked exception, then yes it must be thrown in the method signature. If you create an unchecked e.g. extends from RuntimeException
then you do not need to throw it in the method signature.
Checked exceptions are generally exceptions that are recoverable. Unchecked exception are irrecoverable.