Loading

Q1.

 Which of the following keywords is used to declare exceptions in a method signature?

A. throw

B. throws 

C. exception

D. try

Q2.

Which keyword is used to explicitly throw an exception inside a method?

A. throw
B. throws
C. catch
D. final

Q3.

Which statement about throw is correct?

A. Can throw multiple exceptions at once

B. Can only throw one exception at a time 

C. Declares exceptions in method signature

D. Only used for runtime exceptions

Q4.

Which of the following is true about throws?

A. It is used inside a method body

B. It is used to declare multiple exceptions in method signature
C. Can throw an exception at runtime

D. It terminates the program automatically

Q5.

Which of the following is the correct combination of throw and throws usage?

A. throw new IOException(); inside method, void read() throws IOException in signature 

B. throws new IOException(); inside method, void read() throw IOException in signature

C. throw IOException; inside method, void read() throws IOException in signature
D. throw IOException; in signature, void read() throws IOException inside method