Home / CSE MCQs / JAVA MCQs :: Discussion

Discussion :: JAVA MCQs

  1. Which of these keywords is used to by the calling function to guard against the exception that is thrown by called function?
  2. A.
    try
    B.
    throw
    C.
    throws
    D.
    catch

    View Answer

    Workspace

    Answer : Option C

    Explanation :

    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.


Be The First To Comment