Home / HSC(ENG) - GSEB Board / Reading Mode

๐Ÿ“– Reading Mode: HSC(ENG) - GSEB Board

Chapter: Exception handling in Java โ€ข Total: 175 MCQs

MCQ 1 Run-time errors

When we try to divide an integer numbers by zero what will be the exception generated?

A NullPointerException
B NumberFormatException
C ArithmeticException
D All of the above
MCQ 2 The Finally blocks

In JAVA,the numbers of finally blocks followed in each try block is/are ?

A 2
B 3
C 1
D 5
MCQ 3 The try Block

Which type of code cotained by a try block?

A To handle exceptions of particular type that were created in the associated try block
B Raise to one or mre exceptions
C Executed before the program end
D All of the above
MCQ 4 The catch block

Who can identify the type of exception that a Catch block is to deal?

A File
B variable
C parameter
D functionย 
MCQ 5 The Throw Clause

In java, which clause is used within the method or a constracter that may genterate an exception?

A throw
B throws
C catch
D finally
MCQ 6 The Finally blocks

Which block is always executed , regardless of whether or not expection are thrown during the execution of the associated try block?

A finally
B catch
C (a) and (b) both
D throw
MCQ 7 Run-time errors

WHICH EXCEPTION CLASS IS OBSERVED WHEN AN ATTEMPT TO ACCESS THE ARRAY ELEMENT WITH AN INDEX VALUE THAT IS OUTSIDE THE RANGE OF ARRAY IN JAVA

A ARRY OUT OF BOX
B ARRAY OUT OF INDEX
C ARRAY BOUNDS
D NOT FOUND ARRAY
MCQ 8 The Finally blocks

WHICH BLOCK IS GENERALLY USED TO CLEAN UP AT THE END OF EXECUTING A TRY BLOCK.

A FINALLY
B CATCH
C TRY
D THROWS
MCQ 9 Types of Exceptions

IN OBJECT-ORINTED PROGRAMING, WHAT IS AN INDICATION OF PROBLEM WHICH OCCURS DURING EXECUTION.

A FUNCTION
B STRING (CHAR ARY [])
C ARRAY BOUNDS
D EXCEPETION
MCQ 10 Compile-time errors

IN JAVA IN WHICH CONDITION PROGRAM WILL GET A COMPILATION ERROR AND NOT BE ABLE TO CREATE ".CLASS" FILE.

A SYNTAX ERROR
B USE OF UNDECLARED variable
C WRONG SPELING
D ALL OF THESE
MCQ 11 The try Block

WHICH TYPE OF BLOCK CONTAINS THE CODE THAT MANY GIVE RISE TO ONE OR MORE EXCEPTIONS IN JAVA?

A TRY
B CATCH
C THROW
D FINALLY
MCQ 12 Exception Handling

WHICH BLOCK CONTAINS THE CODE THAT IS TO BE EXECUTED TO HANDLE AN EXCEPTION KEYWORD.

A TRY
B CATCH
C FINALLY
D THROWOBJ
MCQ 13 Types of Exceptions

Which of the following is an advantage of using a try ..... catch block?

A Exceptional events are eliminated
B Exceptional events are reduced
C Exceptional events are integrated with the regular events
D Exceptional events are isolated from regular events
MCQ 14 Types of Exceptions

Which program is error free and will always be executed successfully?

A complied
B interpreted
C debug
D coded
MCQ 15 Types of Exceptions

What is an indication of a problem that occurs during a program's execution which usually signals an error?

A Exception
B compiled
C interpreted
D coded
MCQ 16 Types of Exceptions

Which of the following allows a program to continue executing as if no problem had been encountered or it may modify the use of the program before terminating in an uncontrolled manner?

A Exception handling
B termination
C Exception code
D Error
MCQ 17 Types of Exceptions

What is called all kinds of error conditions in Java?

A Exceptions
B Warm
C Compilation
D termination
MCQ 18 Types of Exceptions

What is used to convert source code into object code?

A compiler
B Interpretation
C Termination
D debugging
MCQ 19 Types of Exceptions

If there is a syntax error in the program we will get a compilation error and will not be able to create the โ€ฆโ€ฆโ€ฆโ€ฆโ€ฆ.file.

A class
B java
C javac
D document
MCQ 20 Types of Exceptions

In how many categories, Error can be broadly classified?

A Compile-time errors
B Run-time errors
C exe time
D both a and b
MCQ 21 Types of Exceptions

Which of the following are the common syntax errors in Java programs?

A Missing semicolon, Use of undeclared variable
B Wrong spellings of identifier or keyword
C Mismatch of bracket
D All of above
MCQ 22 Types of Exceptions

Which type of errors are usually the mistakes of programmer?

A Compile-time errors
B Run-time errors
C Exe time
D None of above
MCQ 23 Types of Exceptions

If there are no syntax errors in the source code then the program will compile successfully and we will get a โ€ฆโ€ฆโ€ฆโ€ฆโ€ฆโ€ฆ file.

A class
B java
C javac
D document
MCQ 24 Types of Exceptions

In โ€ฆโ€ฆโ€ฆโ€ฆ..exception, the exception will be generated during runtime in Java.

A Compile-time
B Run-time
C Exe time
D None of above
MCQ 25 Types of Exceptions

In the field of Computer Science, indicates whether the command or a program is executed successfully or not.

A โ€œExit codeโ€
B โ€œExit statusโ€
C Exit
D Both a or b
MCQ 26 Types of Exceptions

Which code indicates that the command has been executed successfully?

A Code โ€œ0โ€
B Exit 0
C text 0
D Code 1
MCQ 27 Types of Exceptions

Which code indicates that some problem has occurred while executing the command?

A Code โ€œ0โ€
B Exit 0
C text 0
D Code โ€œ1โ€
MCQ 28 Types of Exceptions

Which package contains a hierarchy of dealing with various exceptions?

A Java.lang
B java.io
C java.*
D both a and b
MCQ 29 Types of Exceptions

An attempt to access the array element with an index value that is outside the range of array uses Which of the following exception. Ex. A[13]=99;

A ArrayIndexOutOfBound
B ArrayOutOfBound
C ArrayIndex
D ArrayIndOutBound
MCQ 30 Types of Exceptions

An attempt to divide any number by 0 (zero) uses which of the following exception. Ex. Int a=50/0;

A ArithmeticException
B ArrayIndexOutOfBound
C ArithException
D NumberFormatException
MCQ 31 Types of Exceptions

An attempt to use null in a case where an object is required uses Which of the following exception. Example - String s=null; System.out.println(s.lengh());

A NullPointerException
B ArithmeticException
C ArrayIndexOutOfBound
D All
MCQ 32 Types of Exceptions

An attempt to convert string to a number type uses which of the following exception? Example- String s=โ€xyzโ€ int i=Integer.parseInt(s);

A NumberFormatException
B AirthmeticException
C ArrayIndexOutOfBound
D NullPointer
MCQ 33 Types of Exceptions

An I/O error has occurred while printing uses which of the following exception?

A PrinterIOException
B NullPointerException
C ArrayIndexException
D NullPrinter
MCQ 34 Types of Exceptions

Which type of keywords are used to write an exception handler in Java?

A try
B catch
C finally
D All of these
MCQ 35 Types of Exceptions

Which keywords are used in the presence of exception which represent block of statements?

A try
B catch
C finally
D All of these
MCQ 36 Types of Exceptions

Which block contains the code that may give rise to one or more exceptions?

A try
B catch
C finally
D All of these
MCQ 37 Types of Exceptions

Which block contains the code that is intended to handle exceptions of a particular type that were created in the associated try block?

A try
B catch
C finally
D All of these
MCQ 38 Types of Exceptions

Which block is always executed before the program ends, regardless of whether any exceptions are generated in the try block or not?

A try
B catch
C finally
D All of these
MCQ 39 Types of Exceptions

Which of the following statement contains a block of statements within the curly braces?

A try
B catch
C finally
D All of these
MCQ 40 Types of Exceptions

Which is the code that we want to monitor for exceptions, if a problem occurs during its execution, an exception is thrown?

A try
B catch
C finally
D All of these
MCQ 41 Types of Exceptions

Which block must immediately follow the try block?

A try
B catch
C finally
D All of these
MCQ 42 Types of Exceptions

Which block contains the code that is to be executed to handle an exception?

A try
B catch
C finally
D All of these
MCQ 43 Types of Exceptions

Which block is an exception handler, for a single try block there can be one or more catch blocks?

A try
B catch
C finally
D All of these
MCQ 44 Types of Exceptions

Which block contains a reference to an object which was created and thrown by the try block?

A try
B catch
C finally
D All of these
MCQ 45 Types of Exceptions

Which block is generally used to clean up at the end of executing a try block?

A try
B catch
C finally
D All of these
MCQ 46 Types of Exceptions

Which block is used when we want to be sure that some particular code is to run, no matter what exceptions are thrown within the associated try block?

A try
B catch
C finally
D All of these
MCQ 47 Types of Exceptions

Which block 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
B catch
C finally
D All of these
MCQ 48 Types of Exceptions

Which block must always be followed by at least one block that is either a catch block or a finally block?

A try
B catch
C finally
D All of these
MCQ 49 Types of Exceptions

Which block is associated with a particular try block and it must be located immediately following any catch blocks for the corresponding try block?

A try
B catch
C finally
D throw
MCQ 50 Types of Exceptions

Which keyword is used to explicitly throw an Exception object?

A try
B catch
C finally
D throw
MCQ 51 Types of Exceptions

Who created an exception object and was throwing it automatically?

A JVM
B JDK
C JRE
D UML
MCQ 52 Types of Exceptions

The syntax to throw an exception object is :

A throw exception object;
B throw object;
C threw object
D THROW
MCQ 53 Types of Exceptions

Which cause 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 try
B catch
C finally
D throws
MCQ 54 Types of Exceptions

Which exception classes are not provided by the Java for application specific exceptions?

A Built-in
B user define
C method
D constructor
MCQ 55 Types of Exceptions

Which method of the Scanner class helps in reading integer input from the console?

A nextInt()
B Int( )
C nextint( )
D NEXTINT( )
MCQ 56 Types of Exceptions

In Java, which of the following is not a proper example of common syntax errors?

A Mismatch of bracket
B Use of undeclared variable
C An attempt to-divide any number by 0
D Wrong spelling of identifier or keyword
MCQ 57 Types of Exceptions

In Java, which of the following blocks is always executed before the program ends, regardless of whether any exceptions are generated in the try block or not?

A throw statement
B throws clause
C catch block
D finally block
MCQ 58 Types of Exceptions

In Java, which type of object must be there, to create an exception object and throw it explicitly otherwise compile error occurs?

A java.lang.Throwable
B java.util.Throwable
C java.Throwable
D java.Throwable.Exception
MCQ 59 Types of Exceptions

In Java, which of the following 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 catch block
B finally block
C throws clause
D throw statement
MCQ 60 Types of Exceptions

Which of the following blocks in Java, contains the code that we want to monitor for exceptions?

A catch block
B try block
C finally block
D throws clause
MCQ 61 Types of Exceptions

In Java, which code indicates that some problem occurred while executing the command?

A Exit code: 0
B Exit code: 1
C Exit code: -1
D Exit code: -2
MCQ 62 The try Block

Which of the following elements are not included in try block?

A the keyword try
B the keyword catch
C the curly bracket
D statements that might cause exceptions
MCQ 63 The catch block

In Java, which of the following block handles or takes appropriate action when an exception occurs?

A try
B catch
C throws
D handles
MCQ 64 The Finally blocks

Which clause signifies that there is no catch block within the method that can handle the exception?

A throws
B if
C loop
D array
MCQ 65 Types of Exceptions

By which of the following, an object of arithmetic exception is thrown?

A throw keyword
B try keyword
C JVM
D throw object
MCQ 66 Types of Exceptions

What type of an error occurs when there is a mismatch of bracket in Java program?

A Compile-time error
B Run-time error
C Both A and B
D None of the given
MCQ 67 Types of Exceptions

Which keyword is used to handle exceptions of a Java program?

A catch
B try
C finally
D All of the given
MCQ 68 Types of Exceptions

Which exception class will be applied for the following Java coding? int a[] = new int[4]: a[13] = 99;

A ArithmeticException
B ArrayIndexOutOfBoundsException
C NullPointerException
D NumberFormatException
MCQ 69 Types of Exceptions

For a single try block there can be ____________________ catch blocks.

A only one
B two
C three
D one or more
MCQ 70 Types of Exceptions

Which of the following is an advantage of exception handling in Java?

A It allows writing separate error handling code from the normal code.
B Error types can be grouped and differentiated within the program.
C Assertions can be used to debug the program before deploying it to the clients.
D All of the given
MCQ 71 Types of Exceptions

The object that is to be thrown using the keyword throw, must be of __________ type.

A java.lang.int
B java.lang.string
C java.lang.throw
D java.lang.throwable
MCQ 72 Types of Exceptions

In the field of computer science, which of the following indicates whether the command or program is executed successfully or not?

A Return code
B Exit code
C Exit status
D B or C
MCQ 73 Types of Exceptions

In Java, which block contains the code that may give rise to one or more exceptions?

A catch
B try
C finally
D throw
MCQ 74 Types of Exceptions

Which of the following exception occurs when a string is converted to a number type?

A NullPointerException
B ArithmeticException
C StringException
D NumberFormatException
MCQ 75 Types of Exceptions

___________ blocked is widely used if a file needs to be closed at the completion of the program.

A finally
B try
C catch
D throw
MCQ 76 Types of Exceptions

A method can throw_____________ exceptions.

A one
B maximum
C multiple
D None of the given
MCQ 77 Types of Exceptions

Which block is added to handle the exception object that is explicitly thrown by keyword throw?

A finally
B catch
C try
D None of the given
MCQ 78 Types of Exceptions

Which code in Java indicates that the command/program is executed successfully?

A 1
B 0
C -1
D err
MCQ 79 Types of Exceptions

Which of the following code contains the instructions that is intended to handle exceptions of a particular type?

A throw
B try
C catch
D finally
MCQ 80 Types of Exceptions

Which of the following exception occurs when an attempt is made to access a non-existing file?

A NullPointerException
B ArithmeticException
C FileNotFoundException
D NoFileException
MCQ 81 Types of Exceptions

A block is used when a critical resource is to be released at the completion of the program.

A try
B catch
C finally
D None of the given
MCQ 82 Types of Exceptions

The Java program will not get executed if ____________ block/s is/are not positioned correctly.

A finally
B catch
C A or B
D None of the given
MCQ 83 Types of Exceptions

Each type of exception that a method can throw must be stated at which of the following place in method?

A In header
B In footer
C Out of the program
D During the execution of program
MCQ 84 Types of Exceptions

Which of the following code indicates that some problem has occurred in executing the program and the command is not successfully executed?

A 0
B 1
C 2
D -1
MCQ 85 Types of Exceptions

When is finally block used?

A Before the program terminates
B After the program terminates
C In the beginning of the program
D None of the given
MCQ 86 Types of Exceptions

Which exception class will be applied for Java coding int a = 50/0;?

A ArithmeticException
B ArrayIndexOutOfBoundsException
C NullPointerException
D NumberFormatException
MCQ 87 Types of Exceptions

Which of the following package contains a hierarchy of classes dealing with various exceptions?

A Java.lang
B java.io
C Both A and B
D None of the given
MCQ 88 Types of Exceptions

The finally block is generally used to __________________ at the end of executing a try block.

A clean up
B compile
C summary
D end program
MCQ 89 Types of Exceptions

Which of the following class in Java is used to accept input from the keyboard?

A java.util
B java.lang.scanner
C Java.input
D java.lang.util
MCQ 90 Types of Exceptions

By performing which of the following action, ".class" file can be created?

A When java program is executed (being run)
B When java program is compiled
C When java source code is saved (stored)
D All of the given
MCQ 91 Types of Exceptions

Which of the following block contains the instructions that may give rise to exceptions?

A try
B catch
C throw
D finally
MCQ 92 Types of Exceptions

Which exception class will be applied for the following Java coding? String S = null; System.out.println(s.length( ));

A ArithmeticException
B NullPointerException
C NumberFormatException
D None of the given
MCQ 93 Types of Exceptions

A catch block consists of the keyword catch followed by a single parameter in _____

A ( )
B { }
C [ ]
D <>
MCQ 94 Types of Exceptions

A _____________ block is always executed, regardless of whether or not exceptions are thrown during the execution of the associated try block.

A finally
B catch
C throw
D None of the given
MCQ 95 Types of Exceptions

The ___________ method of the scanner class helps in reading integer input from the console.

A readInt( )
B next Number ( )
C nextInt( )
D All of the given
MCQ 96 Types of Exceptions

______________ package contains a hierarchy of classes dealing with various exceptions.

A java.lang
B java.io
C Both A and B
D None of the given
MCQ 97 Types of Exceptions

Which block must immediately follow the try block?

A catch
B throw
C finally
D A or C
MCQ 98 Types of Exceptions

Which exception class will be applied for the following Java coding? String s = "XYZ"; int i = Integer.parseInt(s);

A ArithmeticException
B NullPointerException
C NumberFormatException
D None of the given
MCQ 99 Types of Exceptions

Java uses keyword/s like ___________________ to write an exception handler.

A try
B catch
C finally
D All of the given
MCQ 100 Types of Exceptions

Which of the following exception class is not provided in Java?

A ArithmeticException
B NullPointerException
C PrinterIOException
D FileException
MCQ 101 Run-time errors

When we try to divide an integer numbers by zero what will be the exception generated?

A NullPointerException
B NumberFormatException
C ArithmeticException
D All of the above
MCQ 102 The Finally blocks

In JAVA,the numbers of finally blocks followed in each try block is/are ?

A 2
B 3
C 1
D 5
MCQ 103 Creating Custom Exception

which of the following classes cannot be used to create anย object ?

A java.io.Reader
B java.io.writer
C java.lang.throwableย 
D (A)and(B)both
MCQ 104 The try Block

Which type of code cotained by a try block?

A To handle exceptions of particular type that were created in the associated try block
B Raise to one or mre exceptions
C Executed before the program end
D All of the above
MCQ 105 The catch block

Who can identify the type of exception that a Catch block is to deal?

A File
B variable
C parameter
D functionย 
MCQ 106 The Throw Clause

In java, which clause is used within the method or a constracter that may genterate an exception?

A throw
B throws
C catch
D finally
MCQ 107 The Finally blocks

Which block is always executed , regardless of whether or not expection are thrown during the execution of the associated try block?

A finally
B catch
C (a) and (b) both
D throw
MCQ 108 Types of Exceptions

Which code indicates that the command has been executed successfully?

A Code โ€œ0โ€
B Exit 0
C text 0
D Code 1
MCQ 109 Types of Exceptions

In Java, which of the following is not a proper example of common syntax errors?

A Mismatch of bracket
B Use of undeclared variable
C An attempt to-divide any number by 0
D Wrong spelling of identifier or keyword
MCQ 110 Types of Exceptions

In Java, which of the following blocks is always executed before the program ends, regardless of whether any exceptions are generated in the try block or not?

A throw statement
B throws clause
C catch block
D finally block
MCQ 111 Types of Exceptions

In Java, which type of object must be there, to create an exception object and throw it explicitly otherwise compile error occurs?

A java.lang.Throwable
B java.util.Throwable
C java.Throwable
D java.Throwable.Exception
MCQ 112 Types of Exceptions

In Java, which of the following 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 catch block
B finally block
C throws clause
D throw statement
MCQ 113 Types of Exceptions

Which of the following blocks in Java, contains the code that we want to monitor for exceptions?

A catch block
B try block
C finally block
D throws clause
MCQ 114 Types of Exceptions

In Java, which code indicates that some problem occurred while executing the command?

A Exit code: 0
B Exit code: 1
C Exit code: -1
D Exit code: -2
MCQ 115 The Finally blocks

Which clause signifies that there is no catch block within the method that can handle the exception?

A throws
B if
C loop
D array
MCQ 116 Run-time errors

WHICH EXCEPTION CLASS IS OBSERVED WHEN AN ATTEMPT TO ACCESS THE ARRAY ELEMENT WITH AN INDEX VALUE THAT IS OUTSIDE THE RANGE OF ARRAY IN JAVA

A ARRY OUT OF BOX
B ARRAY OUT OF INDEX
C ARRAY BOUNDS
D NOT FOUND ARRAY
MCQ 117 Compile-time errors

IN JAVA IN WHICH CONDITION PROGRAM WILL GET A COMPILATION ERROR AND NOT BE ABLE TO CREATE ".CLASS" FILE.

A SYNTAX ERROR
B USE OF UNDECLARED variable
C WRONG SPELING
D ALL OF THESE
MCQ 118 Types of Exceptions

Which of the following is an advantage of using a try ..... catch block?

A Exceptional events are eliminated
B Exceptional events are reduced
C Exceptional events are integrated with the regular events
D Exceptional events are isolated from regular events
MCQ 119 Types of Exceptions

Which type of errors are usually the mistakes of programmer?

A Compile-time errors
B Run-time errors
C Exe time
D None of above
MCQ 120 Types of Exceptions

In the field of Computer Science, indicates whether the command or a program is executed successfully or not.

A โ€œExit codeโ€
B โ€œExit statusโ€
C Exit
D Both a or b
MCQ 121 Types of Exceptions

Which block is an exception handler, for a single try block there can be one or more catch blocks?

A try
B catch
C finally
D All of these
MCQ 122 Types of Exceptions

Who created an exception object and was throwing it automatically?

A JVM
B JDK
C JRE
D UML
MCQ 123 Types of Exceptions

Which exception classes are not provided by the Java for application specific exceptions?

A Built-in
B user define
C method
D constructor
MCQ 124 Types of Exceptions

Which method of the Scanner class helps in reading integer input from the console?

A nextInt()
B Int( )
C nextint( )
D NEXTINT( )
MCQ 125 The try Block

Which of the following elements are not included in try block?

A the keyword try
B the keyword catch
C the curly bracket
D statements that might cause exceptions
MCQ 126 The catch block

In Java, which of the following block handles or takes appropriate action when an exception occurs?

A try
B catch
C throws
D handles
MCQ 127 Types of Exceptions

Which of the following exception occurs when an attempt is made to access a non-existing file?

A NullPointerException
B ArithmeticException
C FileNotFoundException
D NoFileException
MCQ 128 Types of Exceptions

The Java program will not get executed if ____________ block/s is/are not positioned correctly.

A finally
B catch
C A or B
D None of the given
MCQ 129 Types of Exceptions

Which of the following code indicates that some problem has occurred in executing the program and the command is not successfully executed?

A 0
B 1
C 2
D -1
MCQ 130 Types of Exceptions

When is finally block used?

A Before the program terminates
B After the program terminates
C In the beginning of the program
D None of the given
MCQ 131 Types of Exceptions

The finally block is generally used to __________________ at the end of executing a try block.

A clean up
B compile
C summary
D end program
MCQ 132 Types of Exceptions

______________ package contains a hierarchy of classes dealing with various exceptions.

A java.lang
B java.io
C Both A and B
D None of the given
MCQ 133 The Finally blocks

In JAVA,the numbers of finally blocks followed in each try block is/are ?

A 2
B 3
C 1
D 5
MCQ 134 The try Block

Which type of code cotained by a try block?

A To handle exceptions of particular type that were created in the associated try block
B Raise to one or mre exceptions
C Executed before the program end
D All of the above
MCQ 135 The catch block

Who can identify the type of exception that a Catch block is to deal?

A File
B variable
C parameter
D functionย 
MCQ 136 The Finally blocks

Which block is always executed , regardless of whether or not expection are thrown during the execution of the associated try block?

A finally
B catch
C (a) and (b) both
D throw
MCQ 137 Types of Exceptions

In Java, which of the following is not a proper example of common syntax errors?

A Mismatch of bracket
B Use of undeclared variable
C An attempt to-divide any number by 0
D Wrong spelling of identifier or keyword
MCQ 138 Types of Exceptions

In Java, which of the following blocks is always executed before the program ends, regardless of whether any exceptions are generated in the try block or not?

A throw statement
B throws clause
C catch block
D finally block
MCQ 139 Types of Exceptions

In Java, which type of object must be there, to create an exception object and throw it explicitly otherwise compile error occurs?

A java.lang.Throwable
B java.util.Throwable
C java.Throwable
D java.Throwable.Exception
MCQ 140 Types of Exceptions

In Java, which of the following 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 catch block
B finally block
C throws clause
D throw statement
MCQ 141 Types of Exceptions

Which of the following blocks in Java, contains the code that we want to monitor for exceptions?

A catch block
B try block
C finally block
D throws clause
MCQ 142 Types of Exceptions

In Java, which code indicates that some problem occurred while executing the command?

A Exit code: 0
B Exit code: 1
C Exit code: -1
D Exit code: -2
MCQ 143 Run-time errors

When we try to divide an integer numbers by zero what will be the exception generated?

A NullPointerException
B NumberFormatException
C ArithmeticException
D All of the above
MCQ 144 The Finally blocks

In JAVA,the numbers of finally blocks followed in each try block is/are ?

A 2
B 3
C 1
D 5
MCQ 145 The Throw Clause

In java, which clause is used within the method or a constracter that may genterate an exception?

A throw
B throws
C catch
D finally
MCQ 146 Run-time errors

WHICH EXCEPTION CLASS IS OBSERVED WHEN AN ATTEMPT TO ACCESS THE ARRAY ELEMENT WITH AN INDEX VALUE THAT IS OUTSIDE THE RANGE OF ARRAY IN JAVA

A ARRY OUT OF BOX
B ARRAY OUT OF INDEX
C ARRAY BOUNDS
D NOT FOUND ARRAY
MCQ 147 The Finally blocks

WHICH BLOCK IS GENERALLY USED TO CLEAN UP AT THE END OF EXECUTING A TRY BLOCK.

A FINALLY
B CATCH
C TRY
D THROWS
MCQ 148 Compile-time errors

IN JAVA IN WHICH CONDITION PROGRAM WILL GET A COMPILATION ERROR AND NOT BE ABLE TO CREATE ".CLASS" FILE.

A SYNTAX ERROR
B USE OF UNDECLARED variable
C WRONG SPELING
D ALL OF THESE
MCQ 149 Types of Exceptions

Which type of errors are usually the mistakes of programmer?

A Compile-time errors
B Run-time errors
C Exe time
D None of above
MCQ 150 Types of Exceptions

Which keywords are used in the presence of exception which represent block of statements?

A try
B catch
C finally
D All of these
MCQ 151 Types of Exceptions

The syntax to throw an exception object is :

A throw exception object;
B throw object;
C threw object
D THROW
MCQ 152 Types of Exceptions

Which exception classes are not provided by the Java for application specific exceptions?

A Built-in
B user define
C method
D constructor
MCQ 153 Types of Exceptions

What type of an error occurs when there is a mismatch of bracket in Java program?

A Compile-time error
B Run-time error
C Both A and B
D None of the given
MCQ 154 Types of Exceptions

Which exception class will be applied for the following Java coding? int a[] = new int[4]: a[13] = 99;

A ArithmeticException
B ArrayIndexOutOfBoundsException
C NullPointerException
D NumberFormatException
MCQ 155 Types of Exceptions

In the field of computer science, which of the following indicates whether the command or program is executed successfully or not?

A Return code
B Exit code
C Exit status
D B or C
MCQ 156 Types of Exceptions

Which of the following code indicates that some problem has occurred in executing the program and the command is not successfully executed?

A 0
B 1
C 2
D -1
MCQ 157 Types of Exceptions

When is finally block used?

A Before the program terminates
B After the program terminates
C In the beginning of the program
D None of the given
MCQ 158 Types of Exceptions

The finally block is generally used to __________________ at the end of executing a try block.

A clean up
B compile
C summary
D end program
MCQ 159 Types of Exceptions

Which block must immediately follow the try block?

A catch
B throw
C finally
D A or C
MCQ 160 Types of Exceptions

Java uses keyword/s like ___________________ to write an exception handler.

A try
B catch
C finally
D All of the given
MCQ 161 Types of Exceptions

Which code indicates that the command has been executed successfully?

A Code โ€œ0โ€
B Exit 0
C text 0
D Code 1
MCQ 162 Types of Exceptions

Who created an exception object and was throwing it automatically?

A JVM
B JDK
C JRE
D UML
MCQ 163 Types of Exceptions

Which method of the Scanner class helps in reading integer input from the console?

A nextInt()
B Int( )
C nextint( )
D NEXTINT( )
MCQ 164 Types of Exceptions

Which of the following exception occurs when an attempt is made to access a non-existing file?

A NullPointerException
B ArithmeticException
C FileNotFoundException
D NoFileException
MCQ 165 The try Block

Which type of code cotained by a try block?

A To handle exceptions of particular type that were created in the associated try block
B Raise to one or mre exceptions
C Executed before the program end
D All of the above
MCQ 166 The catch block

Who can identify the type of exception that a Catch block is to deal?

A File
B variable
C parameter
D functionย 
MCQ 167 Compile-time errors

IN JAVA IN WHICH CONDITION PROGRAM WILL GET A COMPILATION ERROR AND NOT BE ABLE TO CREATE ".CLASS" FILE.

A SYNTAX ERROR
B USE OF UNDECLARED variable
C WRONG SPELING
D ALL OF THESE
MCQ 168 The try Block

Which of the following elements are not included in try block?

A the keyword try
B the keyword catch
C the curly bracket
D statements that might cause exceptions
MCQ 169 The catch block

In Java, which of the following block handles or takes appropriate action when an exception occurs?

A try
B catch
C throws
D handles
MCQ 170 The Finally blocks

Which clause signifies that there is no catch block within the method that can handle the exception?

A throws
B if
C loop
D array
MCQ 171 Run-time errors

When we try to divide an integer numbers by zero what will be the exception generated?

A NullPointerException
B NumberFormatException
C ArithmeticException
D All of the above
MCQ 172 The Finally blocks

In JAVA,the numbers of finally blocks followed in each try block is/are ?

A 2
B 3
C 1
D 5
MCQ 173 The Finally blocks

Which block is always executed , regardless of whether or not expection are thrown during the execution of the associated try block?

A finally
B catch
C (a) and (b) both
D throw
MCQ 174 Creating Custom Exception

Which class in Java is used to accept input from the Keyboard?

A java.keyboard
B java.util.Input
C java.SCANNER
D java.util.Scanner
MCQ 175 The catch block

Who can identify the type of exception that a Catch block is to deal?

A File
B variable
C parameter
D functionย