Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Give the short answer of the following questions; 1) Which keyword is used to mo

ID: 3830261 • Letter: G

Question

Give the short answer of the following questions; 1) Which keyword is used to monitor statement for exception? ____________ 2) If a statement tries to divide by zero which exception is thrown? ___________ 3) To create our own exception class, we have to ______________ 4) To explicitly throw an exception, __________ keyword is used. 5) Which block gets executed compulsory whether exception is caught or not. ____________ 6) Which of the following line of code is suitable to start a thread? __________ a. Thread t = new Thread(X); b. Thread t = new Thread(X); t.start(); c. X run = new X(); Thread t = new Thread(run); t.start(); d. t = new Thread(); x.run();

Explanation / Answer

1. try...catch is used to monitor statement for Exception

2. if a statement tries to divide by zero "DivideByZeroException" is thrown.

3. To create our own exception class we have to inherit that class from the Exception class.

4.to explicitly throw an exception , "throw" keyword is used.

5."finally" vlock executes complusary weather exception is caught or not.

6.block suitable to start a thread:
   Thread t=new Thread(X);
   t.start();

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote