Menu
Popular Courses
Search

MCQs


Total Questions : 15 | Page 1 of 2 pages
Question 1. Which of these operator is used to generate an instance of an exception than can be thrown by using throw?
  1.    new
  2.    malloc
  3.    alloc
  4.    thrown
 Discuss Question
Answer: Option A. -> new


new is used to create instance of an exception. All of java's built in run-time exceptions have two constructors : one with no parameters and one that takes a string parameter.


Question 2. Which of these keywords is used to generate an exception explicitly?
  1.    try
  2.    finally
  3.    throw
  4.    catch
 Discuss Question
Answer: Option C. -> throw


throw


Question 3. Which of these class is related to all the exceptions that are explicitly thrown?
  1.    Error
  2.    Exception
  3.    Throwable
  4.    Throw
 Discuss Question
Answer: Option C. -> Throwable


Throwable


Question 4. Which of these keywords is used to by the calling function to guard against the exception that is thrown by called function?
  1.    try
  2.    throw
  3.    throws
  4.    catch
 Discuss Question
Answer: Option C. -> throws


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.


Question 5. Which of these handles the exception when no catch is used?
  1.    Default handler
  2.    finally
  3.    throw handler
  4.    Java run time system
 Discuss Question
Answer: Option A. -> Default handler


Default handler


Question 6. When does Exceptions in Java arises in code sequence?
  1.    Run Time
  2.    Compilation Time
  3.    Can Occur Any Time
  4.    None of the mentioned
 Discuss Question
Answer: Option A. -> Run Time


Exceptions in java are run-time errors.


Question 7. Which of these keywords is not a part of exception handling?
  1.    try
  2.    finally
  3.    thrown
  4.    catch
 Discuss Question
Answer: Option C. -> thrown


Exceptional handling is managed via 5 keywords “ try, catch, throws, throw and finally.


Question 8. Which of these keywords is used to manually throw an exception?
  1.    try
  2.    finally
  3.    throw
  4.    catch
 Discuss Question
Answer: Option C. -> throw


throw


Question 9. Which of these keywords must be used to handle the exception thrown by try block in some rational manner?
  1.    try
  2.    finally
  3.    throw
  4.    catch
 Discuss Question
Answer: Option D. -> catch


If an exception occurs within the try block, it is thrown and cached by catch block for processing.


Question 10. Which of these keywords must be used to monitor for exceptions?
  1.    try
  2.    finally
  3.    throw
  4.    catch
 Discuss Question
Answer: Option A. -> try


try


Share this page with your friends!

Share this page with your friends!

Latest Videos

Chapter 1 - GLOBAL STEEL SCENARIO & INDI Part 1 : (13-04-2024) INDUSTRY AND COMPANY AWARENESS (ICA)
Direction Sense Test Part 1 Reasoning (Hindi)
Chapter 1 - RMHP / OHP / OB & BP Part 1 : (14-02-2024) GPOE
Cube & Cuboid Part 1 Reasoning (Hindi)
Data Interpretation (DI) Basic Concept Reasoning (Hindi)
Counting Figures Part 1 Counting Of Straight Lines Reasoning (Hindi)
Real Numbers Part 7 Class 10 Maths
Real Numbers Part 1 Class 10 Maths
Polynomials Part 1 Class 10 Maths

Latest Test Papers

Chapter 3.1 : Overview of Finance & Acco Chapter 3 : Finance & Accounts SAIL E0 - GFM 2024
Chapter 2.1 : Overview Chapter 2 : Materials Management SAIL E0 - GFM 2024
Chapter 1.1 : Personnel Functions- An ov Chapter 1 : Personnel Management SAIL E0 - GFM 2024
GPOE / GPA Combined 1 Free CBT Mock Test SAIL E0 2024
CBT Mixed Test 1 GPOE/GPA SAIL E0 2024