CBSE Class 12 Computer Science Exception Handling In Java MCQs Set D

CBSE Class 12 Computer Science Exception Handling In Java MCQs Set D with answers available in Pdf for free download. The MCQ Questions for Class 12 Computer Science with answers have been prepared as per the latest syllabus, NCERT books and examination pattern suggested in Standard 12 by CBSE, NCERT and KVS. Multiple Choice Questions are an important part of exams for Grade 12 Computer Science and if practiced properly can help you to get higher marks. Refer to more Chapter-wise MCQs for NCERT Class 12 Computer Science and also download more latest study material for all subjects

Exception Handling In Java Class 12 Computer Science MCQ

Class 12 Computer Science students should refer to the following multiple-choice questions with answers for Exception Handling In Java in standard 12. These MCQ questions with answers for Grade 12 Computer Science will come in exams and help you to score good marks

Exception Handling In Java MCQ Questions with Answers

Question: User-defined exceptions can be created by creating a subclass of______class.

  • a) Declaration
  • b) Input
  • c) Method
  • d) Exception

Answer: Exception


Question: If the______accepts data from the keyboard, it is advisable to execute the program at command prompt.

  • a) Program
  • b) Application
  • c) User
  • d) Compiler

Answer: Program


Question: A good program must always handle_______rather than the program being terminated abruptly.

  • a) Declarations
  • b) Inputs
  • c) Methods
  • d) Exceptions

Answer: Exceptions


Question: Advantage of using exception-handling in Java programs is______

  • a) It allows maintaining normal flow of program. In the absence of exception handling, the flow of program is disturbed.
  • b) It allows writing separate error handling code from the normal code.
  • c) Error types can be grouped and differentiated within the program.
  • d) All of these

Answer: All of these


Question: Advantage of using exception-handling in Java programs is______

  • a) Assertions can be used to debug the program before deploying it to the clients.
  • b) It provides an easy mechanism to log various run-time errors while executing the program.
  • c) Both (A) and (B)
  • d) None of these

Answer: Both (A) and (B)


Question: Which of the following is the correct syntax in a user defined exception ?

  • a) Catch (InvalidMarksException eobj)
  • b) Catch(AritmeticException eobj)
  • c) Catch (ArraylndexOutOfBounds e)
  • d) All of these

Answer: Catch (InvalidMarksException eobj)


More Questions...........................


Question: A throws clause can be used in the following manner :

  • a) MethodJVfodifiers methodJVame (parameters) throws Exception list...{......// body of the method......}
  • b) MethodJVIodifiers return_type method_Name (parameters) throws Exception list... {...... / / body of the method......}
  • c) Return_type method_Name (parameters) throws Exception list...{...... // body of the method......}
  • d) None of these

Answer: MethodJVIodifiers return_type method_Name (parameters) throws Exception list... {...... / / body of the method......}


Question: A method header can be like_________

  • a) Perform Division throws Arithmetic Exception, Array lndex Out Of Bounds Exception { ...... // body of the method .... }
  • b) Perform Division() throws Arithmetic Exception, Array Index Out Of Bounds Exception
  • c) Perform Division O throws Arithmetic Exception! ... // body of the method .... }
  • d) Perform Division O throws Arithmetic Exception, Array Index Out Of Bounds Exception { ...... // body of the method .... }

Answer: Perform Division O throws Arithmetic Exception, Array Index Out Of Bounds Exception { ...... // body of the method .... }


Question: The statement "throw myobject;"_________

  • a) Throws the exception object implicitly
  • b) Throws the exception object explicitly
  • c) Throws the object implicitly
  • d) None of these

Answer: Throws the exception object explicitly


Question: Which of these keywords must be used to monitor for exceptions ?

  • a) Try
  • b) Finally
  • c) Throw
  • d) Catch

Answer: Try


Question: The finally block is executed when an exception is thrown, even if no catch matches it. Choose the correct option.

  • a) True
  • b) False
  • c) Can't say
  • d) None of these

Answer: True


Question: Exceptions can be caught or re-thrown to a calling method. Choose the correct option.

  • a) True
  • b) False
  • c) Can't say
  • d) None of these

Answer: True


Question: The throw keyword in a program are not executed. Choose the correct option.

  • a) True
  • b) False
  • c) Can't say
  • d) None of these

Answer: True


Question: Which of these keywords is not a part of exception handling ?

  • a) Try
  • b) Finally
  • c) Thrown
  • d) Catch

Answer: Thrown


Question: Which of the following is true about try/catch blocks in Java ? (I) All try/catch blocks must have a finally block. (II) A try/catch block is limited to two or less catch blocks. (III) Barring the Java virtual machine from exiting, the finally block will always be executed.

  • a) (I) and (III)
  • b) (I) only
  • c) (III) only
  • d) (I) and (II)

Answer: (I) and (III)


Question: What will be the output of the program ? public class Test { public static void main(String [ ] args) { try { return; } finally { System.out.println("Finally");} }

  • a) Finally
  • b) Compilation fails
  • c) The code runs with no output
  • d) An exception is thrown at run time

Answer: Finally


Question: The key words used with exception handling are

  • a) Generate, handled, conclude
  • b) Generate, catch, finally
  • c) Throw, catch, conclude
  • d) Try, catch, finally

Answer: Try, catch, finally


Question: What happen behind the code int a=50/0 ?

  • a) Object of exception class thrown
  • b) Error in Code
  • c) Error message
  • d) None of these

Answer: Object of exception class thrown


Question: When an array is accessed beyond the array size_________exception is thrown.

  • a) Array Element Out Of Limit
  • b) Array Index Out Of Bounds Exception
  • c) Array Index Out Of Bounds
  • d) Array Element Out Of Bounds

Answer: Array Index Out Of Bounds Exception


Question: What is the output of this program ? class exception_handling { public static void main(String args[ ]) try { int a, b; b = 0; a = 5 / b; System.out.print("A"); } catch (Arithmetic Exception e) { System.out.print("B"); } }

  • a) A
  • b) B
  • c) Compilation error
  • d) Run time error

Answer: B

Tags: 

 


Click for more Computer Science Study Material
Cascading Style Sheets and JavaScript
CBSE Class 12 Computer Science Cascading Style Sheets and JavaScript MCQs Set C
CBSE Class 12 Computer Science Cascading Style Sheets and JavaScript MCQs Set D
CBSE Class 12 Computer Science Cascading Style Sheets and JavaScript MCQs Set A
CBSE Class 12 Computer Science Cascading Style Sheets and JavaScript MCQs Set B
Classes and Objects In Java
CBSE Class 12 Computer Science Classes and Objects In Java MCQs Set B
CBSE Class 12 Computer Science Classes and Objects In Java MCQs Set C
CBSE Class 12 Computer Science Classes and Objects In Java MCQs Set D
CBSE Class 12 Computer Science Classes and Objects In Java MCQs Set A
Creating HTML Forms Using KompoZer
CBSE Class 12 Computer Science Creating HTML Forms Using KompoZer MCQs Set F
CBSE Class 12 Computer Science Creating HTML Forms Using KompoZer MCQs Set G
CBSE Class 12 Computer Science Creating HTML Forms Using KompoZer MCQs Set A
CBSE Class 12 Computer Science Creating HTML Forms Using KompoZer MCQs Set H
CBSE Class 12 Computer Science Creating HTML Forms Using KompoZer MCQs Set B
CBSE Class 12 Computer Science Creating HTML Forms Using KompoZer MCQs Set I
CBSE Class 12 Computer Science Creating HTML Forms Using KompoZer MCQs Set C
CBSE Class 12 Computer Science Creating HTML Forms Using KompoZer MCQs Set D
CBSE Class 12 Computer Science Creating HTML Forms Using KompoZer MCQs Set E
Designing Simple Website Using Kompozer
CBSE Class 12 Computer Science Designing Simple Website Using Kompozer MCQs Set A
CBSE Class 12 Computer Science Designing Simple Website Using Kompozer MCQs Set C
CBSE Class 12 Computer Science Designing Simple Website Using Kompozer MCQs Set B
CBSE Class 12 Computer Science Designing Simple Website Using Kompozer MCQs Set D
Exception Handling In Java
CBSE Class 12 Computer Science Exception Handling In Java MCQs Set A
CBSE Class 12 Computer Science Exception Handling In Java MCQs Set B
CBSE Class 12 Computer Science Exception Handling In Java MCQs Set C
CBSE Class 12 Computer Science Exception Handling In Java MCQs Set D
File Handling
CBSE Class 12 Computer Science File Handling MCQs Set C
CBSE Class 12 Computer Science File Handling MCQs Set D
CBSE Class 12 Computer Science File Handling MCQs Set E
CBSE Class 12 Computer Science File Handling MCQs Set F
CBSE Class 12 Computer Science File Handling MCQs Set A
CBSE Class 12 Computer Science File Handling MCQs Set B
File System
CBSE Class 12 Computer Science File System MCQs Set B
CBSE Class 12 Computer Science File System MCQs Set C
CBSE Class 12 Computer Science File System MCQs Set D
CBSE Class 12 Computer Science File System MCQs Set E
CBSE Class 12 Computer Science File System MCQs Set F
CBSE Class 12 Computer Science File System MCQs Set A
Introduction To E Commerce
CBSE Class 12 Computer Science Introduction To E Commerce MCQs Set B
CBSE Class 12 Computer Science Introduction To E Commerce MCQs Set C
CBSE Class 12 Computer Science Introduction To E Commerce MCQs Set D
CBSE Class 12 Computer Science Introduction To E Commerce MCQs Set E
CBSE Class 12 Computer Science Introduction To E Commerce MCQs Set A
Introduction To M Commerce
CBSE Class 12 Computer Science Introduction To M Commerce MCQs Set C
CBSE Class 12 Computer Science Introduction To M Commerce MCQs Set D
CBSE Class 12 Computer Science Introduction To M Commerce MCQs Set E
CBSE Class 12 Computer Science Introduction To M Commerce MCQs Set F
CBSE Class 12 Computer Science Introduction To M Commerce MCQs Set G
CBSE Class 12 Computer Science Introduction To M Commerce MCQs Set A
CBSE Class 12 Computer Science Introduction To M Commerce MCQs Set H
CBSE Class 12 Computer Science Introduction To M Commerce MCQs Set B
Java Basics
CBSE Class 12 Computer Science Java Basics MCQs Set E
CBSE Class 12 Computer Science Java Basics MCQs Set A
CBSE Class 12 Computer Science Java Basics MCQs Set B
CBSE Class 12 Computer Science Java Basics MCQs Set F
CBSE Class 12 Computer Science Java Basics MCQs Set C
CBSE Class 12 Computer Science Java Basics MCQs Set G
CBSE Class 12 Computer Science Java Basics MCQs Set D
Object Oriented Concepts
CBSE Class 12 Computer Science Object Oriented Concepts MCQs Set B
CBSE Class 12 Computer Science Object Oriented Concepts MCQs Set C
CBSE Class 12 Computer Science Object Oriented Concepts MCQs Set D
CBSE Class 12 Computer Science Object Oriented Concepts MCQs Set E
CBSE Class 12 Computer Science Object Oriented Concepts MCQs Set A
Publishing Documents Using Latex
CBSE Class 12 Computer Science Publishing Documents Using Latex MCQs Set D
CBSE Class 12 Computer Science Publishing Documents Using Latex MCQs Set E
CBSE Class 12 Computer Science Publishing Documents Using Latex MCQs Set F
CBSE Class 12 Computer Science Publishing Documents Using Latex MCQs Set G
CBSE Class 12 Computer Science Publishing Documents Using Latex MCQs Set A
CBSE Class 12 Computer Science Publishing Documents Using Latex MCQs Set H
CBSE Class 12 Computer Science Publishing Documents Using Latex MCQs Set B
CBSE Class 12 Computer Science Publishing Documents Using Latex MCQs Set C

Latest NCERT & CBSE News

Read the latest news and announcements from NCERT and CBSE below. Important updates relating to your studies which will help you to keep yourself updated with latest happenings in school level education. Keep yourself updated with all latest news and also read articles from teachers which will help you to improve your studies, increase motivation level and promote faster learning

CBSE Board Examination Scheme of Assessment 2021 2022

A. Academic session to be divided into 2 Terms with approximately 50% syllabus in each term: The syllabus for the Academic session 2021-22 will be divided into 2 terms by following a systematic approach by looking into the interconnectivity of concepts and topics by...

Moderation of Marks Class 11 and 12 Board Exams

The portal for moderation and finalization of results for Class-12 is being opened from 16.07.2021 to 22.07.2021. As Board has to declare the result latest by 31.07.2021, schools have been requested to follow the schedule strictly and complete the moderation within...

CBSE Class 10 Revised Syllabus

Last year CBSE had to reduce the syllabus because of the pandemic situation but it was not very effective because there were no examinations. This year to avoid any confusion and conflict, CBSE has decided to reduce the syllabus into term 1 and term 2. 50 percent of...

MCQ Question based CBSE examination

For 2021-22 CBSE has launched MCQ question-based examination for Term 1 & Term 2 board examinations. The entire syllabus has been divided into two parts each including 50% of the entire syllabus. To score well, students must practice as per the new CBSE term-wise...

Score well in Class 12 English Boards Exam

12th Board exams are an important part of students' lives. The marks obtained in the board exam decide the college in which one can study. In class 12 the syllabus of each and every subject increases vastly and it is difficult to cover up every point. In English also...

How To Solve Unseen Passages In English

Unseen passages may contain one or many paragraphs. This is one of the important yet easy parts for a student to get marks. Students should thoroughly study and understand the passage to answer the related questions. The unseen passages are there just to test the...

×
Studies Today