Class 12 Computer Science Exception Handling In Java MCQ Question with Answer

Class 12 MCQs

Exception Handling In Java Class 12 MCQ is one of the best strategies to prepare for the CBSE Class 12 Board exam. If you want to complete a grasp concept or work on one’s score, there is no method except constant practice. Students can improve their speed and accuracy by doing more MCQ on Exception Handling In Java class 12, which will help them all through their board test.

Exception Handling In Java Class 12 MCQ

Class 12 Computer Science MCQ with answers are given here to chapter 5 Exception Handling In Java. These MCQs are based on the latest CBSE board syllabus and relate to the latest Class 12 Computer Science syllabus. By Solving these Class 12 MCQs, you will be able to analyze all of the concepts quickly in the chapter and get ready for the Class 12 Annual exam.

Learn Class 12 Exception Handling In Java MCQs with answers pdf free download according to the latest CBSE and NCERT syllabus. Students should prepare for the examination by solving CBSE Class 12 Computer Science Exception Handling In Java MCQ with answers given below.

Question 1: The_______in a program results in an abnormal execution and it may lead to abnormal termination of the program.

  • a) Exception
  • b) Error
  • c) Message
  • d) Mistake
Answer

A

Question 2: It is usually understood that a compiled program is error free and will always______successfully.

  • a) Complete
  • b) Execute
  • c) Perform
  • d) Accomplish
Answer

B

Question 3: An is an indication of a problem thatc occurs during a program’s execution.

  • a) Exception
  • b) Inaccuracy
  • c) Error
  • d) E-fault
Answer

A

Question 4: In few cases a compiled program can_______while it its executing.

  • a) Terminate
  • b) Finish
  • c) Dismiss
  • d) Discharge
Answer

A

Question 5: Although exceptions occur infrequently, one has to be careful in handling such cases while writing the_______

  • a) Program
  • b) Message
  • c) Data
  • d) Code
Answer

D

Question 6: ________handling allows a program to continue executing as if no problem had been encountered or it may notify the user of the problem before terminating in an uncontrolled manner.

  • a) Data
  • b) Program
  • c) Error
  • d) Exception
Answer

D

Question 7: There are few standard______available in Java, a technique to guarantee that a particular I block of code will always be executed, even if I exceptions are present in our program.

  • a) Data info
  • b) Programs
  • c) Errors
  • d) Exceptions
Answer

D

Question 8: An exception usually signals an_______

  • a) Exception
  • b) Inaccuracy
  • c) Error
  • d) E-fault
Answer

C

Question 9: In Java, all kinds of error conditions are called________

  • a) Methods
  • b) Programs
  • c) Errors
  • d) Exceptions
Answer

D

Question 10: Errors can be broadly classified into_______categories.

  • a) Four
  • b) Three
  • c) Two
  • d) Five
Answer

C

Question 11: ________is a type of error produced in java programs.

  • a) Compile-time errors
  • b) Run-time errors
  • c) Both (A) and (B)
  • d) None of these
Answer

C

Question 12: A________is used to convert source code into object code.

  • a) Compiler
  • b) Interpreter
  • c) Translator
  • d) Decoder
Answer

A

Question 13: A compiler is used to convert_______code into object code.

  • a) Home
  • b) Source
  • c) Beginning
  • d) Program
Answer

B

Question 14: Examples of some common syntax errors are missing like a________

  • a) Semicolon
  • b) Use of undeclared variable
  • c) Wrong spellings of identifier or keyword
  • d) All of these
Answer

D

Question 15: The Java_______suggests in an output, the type of error, along with the line number where the error has occurred.

  • a) Compiler
  • b) Interpreter
  • c) Translator
  • d) Decoder
Answer

A

Question 16: Compile-time_____are usually the mistake of a programmer and it does not allow the program to compile unless they are solved.

  • a) Methods
  • b) Programs
  • c) Errors
  • d) Exceptions
Answer

C

Question 17: If there is a syntax error in the program, a compilation error is displayed and______file is not created.

  • a) .Source
  • b) .Dat
  • c) .Class
  • d) .Obj
Answer

C

Question 18: In the field of Computer Science, “Exit code” or “Exit status” indicates whether the command or a______executed successfully or not.

  • a) Data type
  • b) Program
  • c) error
  • d) Method
Answer

D

Question 19: If there are no syntax errors in the source code then the program will compile successfully and will get a_______file.

  • a) .source
  • b) .dat
  • c) .class
  • d) .obj
Answer

C

Question 20: Code_______indicates that some problem occurred while executing the command.

  • a) 1
  • b) -1
  • c) 0.0
  • d) 0
Answer

1

Question 21: Code_______indicates that the command executed successfully.

  • a) 1
  • b) -1
  • c) 0.0
  • d) 0
Answer

D

Question 22: The________contains a hierarchy of classes dealing with various exceptions.

  • a) Java.lang package
  • b) Java.io package
  • c) Both (A) and (B)
  • d) None of these
Answer

C

Question 23: The array “_______ citylist [ ] = {“Ahmedabad”, “Baroda”, “Rajkot”, “Surat”};” contains name of four different cities.

  • a) String
  • b) Int
  • c) Long
  • d) Boolean
Answer

A

Question 24: For each type of exception, there are corresponding______classes in Java.

  • a) Programs
  • b) Exceptions
  • c) Java.lang
  • d) Java.io
Answer

B

Question 25: An attempt to divide any number by 0 uses______Exception class.

  • a) Array lndex Out Of Bounds Exception
  • b) Arithmetic Exception
  • c) File Not Found Exception
  • d) All of these
Answer

C

Question 26: An attempt to access the array element with an index value that is outside the range of array uses_______Exception class.

  • a) Array lndex Out Of Bounds Exception
  • b) Arithmetic Exception
  • c) File Not Found Exception
  • d) All of these
Answer

A

Question 27: An attempt to divide any number by 0 uses_______Exception class.

  • a) Array lndex Out Of Bounds Exception
  • b) Arithmetic Exception
  • c) File Not Found Exception
  • d) All of these
Answer

B

Question 28: An I/O error has occurred while printing uses ………. Exception class.

  • a) Printer lO Exception
  • b) Null Pointer Exception
  • c) Number Format Exception
  • d) None of these
Answer

A

Question 29: An attempt to use null in a case where an object is required uses_____Exception class.

  • a) PrinterlOException
  • b) NullPointerException
  • c) NumberFormatException
  • d) None of these
Answer

B

Question 30: An attempt to convert string to a number type uses_______Exception class.

  • a) PrinterlOException
  • b) NullPointerException
  • c) NumberFormatException
  • d) None of these
Answer

C

Question 31: An______is an error condition.

  • a) Allowance
  • b) Exclusion
  • c) Error
  • d) Exception
Answer

D

Question 32: The following code will result in Exception. int numerator = 15; int denominator = 0; answer; answer = numerator / denominator;

  • a) Array lndex Out Of Bounds Exception
  • b) Arithmetic Exception
  • c) File Not Found Exception
  • d) All of these
Answer

B

Question 33: What is the full form of JVM ?

  • a) Java Virtual Mechanism
  • b) Java Virtual Method
  • c) Java Virtual Machine
  • d) Java Virtual Manner
Answer

C

Question 34: Java uses keywords like_______to write an exception handler.

  • a) Try
  • b) Catch
  • c) Finally
  • d) All of these
Answer

D

Question 35: ________handling is an object-oriented technique for managing errors.

  • a) Allowance
  • b) Exclusion
  • c) Error
  • d) Exception
Answer

D

Question 36: While performing exception handling, one has to try to ensure that the program does not______abruptly nor does it generate unexpected output.

  • a) Terminate
  • b) Finish
  • c) Dismiss
  • d) Discharge
Answer

A

Question 37: A________contains the code that is intended to handle exceptions of a particular type that were created in the associated try block.

  • a) Try block
  • b) Catch block
  • c) Finally block
  • d) All of these
Answer

B

Question 38: The keywords______are used in the presence of exceptions, these keywords represent block of statements.

  • a) Try
  • b) Catch
  • c) Finally
  • d) All of these
Answer

D

Question 39: A______contains the code that may give rise to one or more exceptions.

  • a) Try block
  • b) Catch block
  • c) Finally block
  • d) All of these
Answer

A

Question 40: A______block may give rise to one or more exceptions.

  • a) Try
  • b) Catch
  • c) Finally
  • d) None of these
Answer

A

Question 41: A_______is always executed before the program ends, regardless of whether any exceptions are generated in the try block or not.

  • a) Try block
  • b) Catch block
  • c) Finally block
  • d) All of these
Answer

C

Question 42: The______statement contains a block of statements within the braces.

  • a) Try
  • b) Catch
  • c) Finally
  • d) None of these
Answer

A

Question 43: _______contains the code that is to be created to handle an exception.

  • a) Try block
  • b) Catch block
  • c) Finally block
  • d) All of these
Answer

B

Question 44: The______is an exception handler.

  • a) Try block
  • b) Catch block
  • c) Finally block
  • d) All of these
Answer

B

Question 45: The code between a try block creates a………. exception.

  • a) Double
  • b) Single
  • c) Triple
  • d) None of these
Answer

B

Question 46: The_______must immediately follow the try block.

  • a) Try block
  • b) Catch block
  • c) Finally block
  • d) All of these
Answer

B

Question 47: The catch code to handle exception has to be written between_________

  • a) Codes
  • b) Blocks
  • c) Parentheses
  • d) Parameters
Answer

C

Question 48: For a______try block there can be one or more catch blocks.

  • a) Single
  • b) Double
  • c) Tirple
  • d) None of these
Answer

A

Question 49: A catch block consists of the keyword catch followed by a single______

  • a) Operator
  • b) Method
  • c) Block
  • d) Parameter
Answer

D

Question 50: Any program which tries to access array element by specifying index position that is outside the range leads to an_______

  • a) Illegal message
  • b) Exclusion
  • c) Error
  • d) Exception
Answer

D

Question 51: The_______identifies the type of exception that the block is to deal with.

  • a) Operator
  • b) Method
  • c) Block
  • d) Parameter
Answer

D

Question 52: Java supports______types of exceptions

  • a) Various
  • b) Single
  • c) Multiple
  • d) Some
Answer

A

Question 53: The catch block contains a______to object “eobj” which is created and thrown by the try block.

  • a) Space
  • b) Cell
  • c) Memory
  • d) Reference
Answer

D

Question 54: When above kind of exception occurs, an object of type is created and is thrown.

  • a) Array lndex Out Of Bounds Exception
  • b) Arithmetic Exception
  • c) File Not Found Exception
  • d) All of these
Answer

A

Question 55: A corresponding_______handles the above exception and does not allow the program to terminate unexpectedly.

  • a) Try block
  • b) Catch block
  • c) Finally block
  • d) All of these
Answer

B

Whoever needs to take the CBSE Class 12 Board Exam should look at this MCQ. To the Students who will show up in CBSE Class 12 Computer Science Board Exams, It is suggested to practice more and more questions. Aside from the sample paper you more likely had solved. These Exception Handling In Java Class 12 MCQ are ready by the subject specialists themselves.

Question 56: If a particular file has to be uploaded to a remote computer, an exception may occur if the file is not present in the_______

  • a) Computer
  • b) Network
  • c) Internet
  • d) System
Answer

A

Question 57: In a single program_______exceptions can occur.

  • a) Various
  • b) Single
  • c) Multiple
  • d) Some
Answer

C

Question 58: If a particular file has to be uploaded to a remote computer, it may lead to_______distinct exceptions.

  • a) One
  • b) Two
  • c) Three
  • d) Four
Answer

B

Question 59: The code that generates exception should be written within the______

  • a) Try block
  • b) Catch block
  • c) Finally block
  • d) All of these
Answer

A

Question 60: If a particular file has to be uploaded to a remote computer, another exception may occur if the computer is not connected to the________

  • a) Computer
  • b) Network
  • c) Internet
  • d) System
Answer

B

Question 61: There is a provision in Java to support______exceptions.

  • a) Various
  • b) Single
  • c) Multiple
  • d) Some
Answer

C

Question 62: The catch block, must be the last block when there are multiple catch blocks.

  • a) First
  • b) Second
  • c) Third
  • d) Default
Answer

D

Question 63: There can be multiple________to handle each type of exception separately.

  • a) Try blocks
  • b) Catch blocks
  • c) Finally blocks
  • d) All of these
Answer

B

Question 64: The last______can handle any type of exception.

  • a) Try block
  • b) Catch block
  • c) Finally block
  • d) None of these
Answer

B

Question 65: The_______is generally used to clean up the end of executing a try block.

  • a) Try block
  • b) Catch block
  • c) Finally block
  • d) All of these
Answer

C

Question 66: While writing the program, the order of the specific catch blocks does not matter but the______block has to be placed at the end of all catch blocks.

  • a) First
  • b) Second
  • c) Third
  • d) Default
Answer

D

Question 67: _______try blocks can be nested together, but care must be taken to write a corresponding catch block for each try block.

  • a) Various
  • b) Single
  • c) Multiple
  • d) Some
Answer

C

Question 68: A______is widely used if a file needs to be closed or a critical resource is to be released at the completion of the program.

  • a) Try block
  • b) Catch block
  • c) Finally block
  • d) All of these
Answer

C

Question 69: A________is used when the programmer wants to be sure that some particular code is to be run, no matter what exceptions are thrown within the associated try block.

  • a) Try block
  • b) Catch block
  • c) Finally block
  • d) All of these
Answer

C

Question 70: A________is always executed, regardless of whether or not exceptions are thrown during the execution of the associated try block.

  • a) Try block
  • b) Catch block
  • c) Finally block
  • d) All of these
Answer

C

Question 71: A________is associated with a particular try block and it must be located immediately following any catch blocks for the corresponding try block.

  • a) Finally block
  • b) Catch block
  • c) Try block
  • d) None of these
Answer

A

Question 72: Each try block must always be followed by at least________that is either a catch block or a finally block.

  • a) One block
  • b) Two blocks
  • c) Three blocks
  • d) None of these
Answer

A

Question 73: However, in the presence of______the program executes the statements within the finally block before it gets terminated.

  • a) Try block
  • b) Catch block
  • c) Finally block
  • d) All of these
Answer

C

Question 74: The_______keyword is used to explicitly throw an Exception object.

  • a) Throws
  • b) Throws
  • c) Throw
  • d) Try
Answer

C

Question 75: If there are no______then the finally block can be positioned immediately after the try block.

  • a) Try blocks
  • b) Catch blocks
  • c) Finally blocks
  • d) None of these
Answer

B

Question 76: If the finally block or catch blocks are not positioned correctly, then the program will not

  • a) Compile
  • b) Interpret
  • c) Translate
  • d) Decode
Answer

A

Question 77: The object that one throws, must be of type of java.lang________, otherwise a compile error occurs.

  • a) Throwable
  • b) Throws
  • c) Throw
  • d) Throws
Answer

A

Question 78: For example, an object of______was created when one tries to perform a divide by zero operation.

  • a) Array lndex Out Of Bounds Exception
  • b) Arithmetic Exception
  • c) File Not Found Exception
  • d) None of these
Answer

B

Question 79: Java does provide mechanism to create an______object and throw it explicitly.

  • a) Illusion
  • b) Exclusion
  • c) Error
  • d) Exception
Answer

D

Question 80: Any subsequent statements in the_______are not executed.

  • a) Try block
  • b) Try or catch block
  • c) Catch block
  • d) Try or finally block
Answer

B

Question 81: The syntax to throw an exception object is

  • a) Throw exception_object;
  • b) Throws exception_object;
  • c) Throws exception_object
  • d) Throw object;
Answer:

A

Question 82: When a_______statement is encountered, a search for matching catch block begins.

  • a) Throwable
  • b) Throws
  • c) throw
  • d) Throws
Answer

C

Question 83: When a______or a method that can throw exceptions is written to its caller, it is useful to document that fact.

  • a) Constructor
  • b) Variable
  • c) Operator
  • d) Compiler
Answer

A

Question 84: There are______alternative approaches to handle, when an exception occurs in a method or a constructor.

  • a) One
  • b) Two
  • c) Three
  • d) Four
Answer

B

Question 85: A_______clause can be used in a method declaration or constructor declaration to inform that the code within the constructor or method may throw an Exception.

  • a) Throwable
  • b) Throws
  • c) throw
  • d) throws
Answer

D

Question 86: Each type of______that a method can throw must be stated in the method header.

  • a) Declaration
  • b) Variable
  • c) Error
  • d) Exception
Answer

D

Question 87: The________keyword is used with the declaration of method.

  • a) Throwable
  • b) Throws
  • c) throw
  • d) throws
Answer

A

Question 88: A_______can throw multiple exceptions.

  • a) Method
  • b) Variable
  • c) Operator
  • d) Compiler
Answer

A

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

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

D

Question 90: _______allows creating own exception classes according to application-specific problems.

  • a) C ++
  • b) C
  • c) Java
  • d) PHP
Answer

C

Question 91: _______does not provide built-in exception classes for application specific exceptions.

  • a) C ++
  • b) C
  • c) Java
  • d) PHP
Answer

C

Question 92: 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

D

Question 93: 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

A

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

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

D

 

Question 95: 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

B

Question 96: 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

C

Question 97: 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

A

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

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

A

Question 99: 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

A

Question 100: 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

D

Question 101: 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

B

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

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

C

Question 103: 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

A

Question 104: 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

A

Question 105: 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

D

Question 106: 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

A

Question 107: 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

A

Question 108: 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

Question 109: 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

A

Question 110: 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

B

You can easily get good marks If you study with the help of Class 12 Exception Handling In Java MCQ. We trust that information provided is useful for you. NCERT Exception Handling In Java Class 12 MCQ PDF Free Download would without a doubt create positive results.

We hope the information shared above in regards to MCQ on Exception Handling In Java Class 12 with Answers has been helpful to you. if you have any questions regarding CBSE Class 12 Computer Science Solutions MCQs Pdf, write a comment below and we will get back to you as soon as possible.

Exception Handling In Java Class 12 MCQ

Frequently Asked Question (FAQs)

How many MCQ questions are there in Class 12 chapter 5 Computer Science?

In Class 12 chapter 5 Computer Science, we have provided 110 Important MCQ Questions, But in the future, we will add more MCQs so that you can get good marks in the Class 12 exam.

Can we score good marks in Class 12 Computer Science with the help of Exception Handling In Java MCQ Questions?

Yes, MCQ Question is one of the best strategies to make your preparation better for the CBSE Board Exam. It also helps to know the student’s basic understanding of each chapter. So, You can score good marks in the Class 12 Computer Science exam.

Leave a Reply

Your email address will not be published.