Home » JAVA Programming » Exceptions » Question
  1. Which of these keywords is used to by the calling function to guard against the exception that is thrown by called function?
    1. catch
    2. throws
    3. try
    4. throw
    5. None of these
Correct Option: B

If a method is capable of causing an exception that it does not handle. It must specify this behaviour the behaviour so that callers of the method can guard themselves against that exception. This is done by using throws clause in methods declaration.



Your comments will be displayed only after manual approval.