Questions · Page 3 of 4

MCQ

MCQ 1011 Mark
Which of the following is known as exceptions?
  • A
    An indication of a problem that occurs during program’s execution
  • B
    All kind of error conditions
  • a and b both
  • D
    Program’s successful execution
Answer
Correct option: C.
a and b both
a and b both
View full question & answer
MCQ 1021 Mark
Which type of anticipatory arrangement is “exceptions” called?
  • A
    To continue executing as if no problem had been encountered.
  • B
    To notify the user of the problem before terminating in an uncontrolled manner.
  • a and b both
  • D
    None of these
Answer
Correct option: C.
a and b both
a and b both
View full question & answer
MCQ 1031 Mark
Which of the following must be handled carefully while writing the code?
  • A
    Source code
  • Exceptions
  • C
    Object code
  • D
    a and b both
Answer
Correct option: B.
Exceptions
Exceptions
View full question & answer
MCQ 1041 Mark
Which message do exceptions generally show?
  • Error message
  • B
    Help message
  • C
    Alert message
  • D
    All of these
Answer
Correct option: A.
Error message
Error message
View full question & answer
MCQ 1051 Mark
Which of the following may notify the user of the problem before terminating in an uncontrolled manner?
  • Exception
  • B
    Object code
  • C
    Source code
  • D
    Inappropriateness
Answer
Correct option: A.
Exception
Exception
View full question & answer
MCQ 1061 Mark
Which of the following allows a program to continue executing as if no problem had been encountered?
  • Exception
  • B
    Object code
  • C
    Source code
  • D
    Inappropriateness
Answer
Correct option: A.
Exception
Exception
View full question & answer
MCQ 1071 Mark
Which of the following is an indication of a problem that occurs during a program’s execution?
  • Exception
  • B
    Object code
  • C
    Source code
  • D
    Inappropriateness
Answer
Correct option: A.
Exception
Exception
View full question & answer
MCQ 1081 Mark
The exception results into following one.
  • A
    It results in an abnormal execution.
  • B
    It may lead to abnormal termination of the program.
  • a and b both
  • D
    None of these
Answer
Correct option: C.
a and b both
a and b both
View full question & answer
MCQ 1091 Mark
Which of the following cases can be known “exceptions”?
  • A
    A program of downloading a web page is executed in a computer where there is no internet connection.
  • B
    A program to open a file that does not exist in the system.
  • C
    To divide any number with zero and get unexpected result.
  • All of these
Answer
Correct option: D.
All of these
All of these
View full question & answer
MCQ 1101 Mark
Which of the following condition may lead to abnormal termination of the program?
  • Exceptional
  • B
    Abnormal
  • C
    Normal
  • D
    Related
Answer
Correct option: A.
Exceptional
Exceptional
View full question & answer
MCQ 1111 Mark
Under which of the following conditions the program will be executed as unexpected?
  • A
    Normal
  • B
    Abnormal
  • Exceptional
  • D
    Related
Answer
Correct option: C.
Exceptional
Exceptional
View full question & answer
MCQ 1121 Mark
Which of the following is least important to know if you want to be able to use a method to its full potential?
  • the number of statements within the method
  • B
    the type of arguments the method requires
  • C
    the method’s return type
  • D
    the type of Exceptions the method throws
Answer
Correct option: A.
the number of statements within the method
the number of statements within the method
View full question & answer
MCQ 1131 Mark
Which of the following methods can throw an Exception?
  • methods with throws clause
  • B
    methods with a catch block
  • C
    methods with a try block
  • D
    methods with finally block
Answer
Correct option: A.
methods with throws clause
methods with throws clause
View full question & answer
MCQ 1141 Mark
Which of the following is an advantage of using a try ... catch block
  • A
    Exceptional events are eliminated.
  • B
    Exceptional events are reduced.
  • Exceptional events are integrated with regular events:
  • D
    Exceptional events are isolated from regular events.
Answer
Correct option: C.
Exceptional events are integrated with regular events:
Exceptional events are integrated with regular events:
View full question & answer
MCQ 1151 Mark
What will happen when a try block does not generate an Exception and you have included multiple catch blocks?
  • A
    they all execute
  • B
    only the first matching one executes
  • no catch block executes
  • D
    only the first catch block executes.
Answer
Correct option: C.
no catch block executes
no catch block executes
View full question & answer
MCQ 1161 Mark
Which of the following should be within a catch block?
  • any number of statements to handle Exception
  • B
    single statement that handles Exception
  • C
    finally, block
  • D
    throws keyword
Answer
Correct option: A.
any number of statements to handle Exception
any number of statements to handle Exception
View full question & answer
MCQ 1171 Mark
Which of the following block handles or takes appropriate action when an Exception occurs?
  • A
    try
  • catch
  • C
    throws
  • D
    handles
Answer
Correct option: B.
catch
catch
View full question & answer
MCQ 1181 Mark
Which of the following elements is not included in try block?
  • the keyword catch
  • B
    the keyword try
  • C
    the curly braces
  • D
    statements that might cause exceptions
Answer
Correct option: A.
the keyword catch
the keyword catch
View full question & answer
MCQ 1191 Mark
Which of the following statements is true?
  • Exceptions and Errors are the same thing.
  • B
    Errors are more serious than Exceptions.
  • C
    Errors and Exceptions are equally serious.
  • D
    Exceptions are more serious than Errors.
Answer
Correct option: A.
Exceptions and Errors are the same thing.
Exceptions and Errors are the same thing.
View full question & answer
MCQ 1201 Mark
Which of the following is a correct word for all Java Exceptions?
  • Errors
  • B
    Runtime Exceptions
  • C
    Throwables
  • D
    Omissions
Answer
Correct option: A.
Errors
Errors
View full question & answer
MCQ 1211 Mark
Which of the following refers to an error condition in object-oriented programming terminology?
  • exception
  • B
    anomaly
  • C
    abbreviation
  • D
    deviation
Answer
Correct option: A.
exception
exception
View full question & answer
MCQ 1221 Mark
…………… does not provide built-in exception classes for application specific exceptions.
  • A
    C ++ 
  • B
    C
  • Java 
  • D
    PHP
Answer
Correct option: C.
Java 
(C) Java
View full question & answer
MCQ 1231 Mark
The …………… keyword is used with the declaration of method.
  • A
    throwable 
  • B
    threws 
  • C
    throw 
  • throws
Answer
Correct option: D.
throws
(D) throws
View full question & answer
MCQ 1241 Mark
Java does provide mechanism to create a …………. object and throw it explicitly.
  • A
    illusion 
  • B
    exclusion 
  • C
    error 
  • exception
Answer
Correct option: D.
exception
(D) exception
View full question & answer
MCQ 1251 Mark
Errors can be broadly classified into ………… categories.
  • A
    four 
  • B
    three 
  • two 
  • D
    five
Answer
Correct option: C.
two 
(C) two
View full question & answer
MCQ 1261 Mark
If there are no …………. Then the finally block can be positioned immediately after the try block.
  • A
    try block 
  • catch blocks 
  • C
    finally blocks 
  • D
    none of these
Answer
Correct option: B.
catch blocks 
(B) catch blocks
View full question & answer
MCQ 1271 Mark
The last ……….. can handle any type of exceptions.
  • A
    try block 
  • catch block 
  • C
    finally block
  • D
    none of these
Answer
Correct option: B.
catch block 
(B) catch block
View full question & answer
MCQ 1281 Mark
In Java, all kinds of error conditions are called ……… .
  • A
    methods 
  • B
    programs 
  • C
    errors 
  • exceptions
Answer
Correct option: D.
exceptions
(D) exceptions
View full question & answer
MCQ 1291 Mark
It is usually understood that a compiled program is error free and will always ………. successfully.
  • A
    complete 
  • execute 
  • C
    perform 
  • D
    accomplish
Answer
Correct option: B.
execute 
(B) execute
View full question & answer
MCQ 1301 Mark
Any program which tries to access array element by specifying index position that is outside the range leads to a …………… .
  • A
    illegal message 
  • B
    exclusion 
  • C
    errors 
  • exceptions
Answer
Correct option: D.
exceptions
(D) exceptions
View full question & answer
MCQ 1311 Mark
An attempt to convert string to a number type uses …………. Exception class.
  • A
    StringformatException      
  • B
    ArithmeticException 
  • NumberFormatException 
  • D
    ArrayIndexException
Answer
Correct option: C.
NumberFormatException 
(C) NumberFormatException
View full question & answer
MCQ 1321 Mark
The exceptions which can be thrown using throw is to be indicated in ………… .
  • in header 
  • B
    in footer 
  • C
    in the middle 
  • D
    at the end of program
Answer
Correct option: A.
in header 
(A) in header
View full question & answer
MCQ 1331 Mark
………… class is used to accept input from the keyboard.
  • A
    java.util.lang 
  • B
    java.util.library 
  • java.lang.scanner 
  • D
    Java.util.property
Answer
Correct option: C.
java.lang.scanner 
(C) java.lang.scanner
View full question & answer
MCQ 1341 Mark
The exceptions object which is thrown using throw keyword can be taken care of using ………… .
  • A
    the try block 
  • the catch block 
  • C
    the finally block 
  • D
    the throw block
Answer
Correct option: B.
the catch block 
(B) the catch block
View full question & answer
MCQ 1351 Mark
Using ………….. method integer values can be accepted using scanner class.
  • nextInt() 
  • B
    nextFloat() 
  • C
    nextNumber() 
  • D
    nextperseFloat()
Answer
Correct option: A.
nextInt() 
(A) nextInt()
View full question & answer
MCQ 1361 Mark
Object which is thrown using throws keyword must be of ……… type.
  • java.lang.throwable 
  • B
    java.lang.string 
  • C
    java.lang.scanner 
  • D
    Java.lang.throw
Answer
Correct option: A.
java.lang.throwable 
(A) java.lang.throwable
View full question & answer
MCQ 1371 Mark
Arithmetic exception is thrown using ……….. .
  • A
    throw keyword 
  • B
    with try block 
  • using JVM 
  • D
    throws statement
Answer
Correct option: C.
using JVM 
(C) using JVM
View full question & answer
MCQ 1381 Mark
…………… block handles the exceptions in Java program.
  • A
    The catch block 
  • Default type catch block 
  • C
    The finally block 
  • D
    The throw block
Answer
Correct option: B.
Default type catch block 
(B) Default type catch block
View full question & answer
MCQ 1391 Mark
…………. holds the indication of ‘eobj’ object.
  • A
    Try block 
  • Catch block 
  • C
    Finally block 
  • D
    All of these
Answer
Correct option: B.
Catch block 
(B) Catch block
View full question & answer
MCQ 1401 Mark
What is the use of throw keyword ?
  • A
    To move necessary statements 
  • To throw the objects of an exception
  • C
    To exit the program
  • D
    To take control of the program in the beginning
Answer
Correct option: B.
To throw the objects of an exception
(B) To throw the objects of an exception
View full question & answer
MCQ 1411 Mark
Where is the block for default type catch division in the program ?
  • A
    After first catch block 
  • last catch block 
  • C
    At the end of the program 
  • D
    This is not possible
Answer
Correct option: B.
last catch block 
(B) last catch block
View full question & answer
MCQ 1421 Mark
……… block can throw different exceptions.
  • The try block 
  • B
    The catch block 
  • C
    The finally block 
  • D
    All of these
Answer
Correct option: A.
The try block 
(A) The try block
View full question & answer
MCQ 1431 Mark
The possibilities of arising exceptions are written in ………… .
  • A
    catch 
  • try 
  • C
    finally 
  • D
    throw
Answer
Correct option: B.
try 
(B) try
View full question & answer
MCQ 1441 Mark
……… block create ‘eobj’ object.
  • Try block 
  • B
    Catch block  
  • C
    Finally block 
  • D
    All of these
Answer
Correct option: A.
Try block 
(A) Try block
View full question & answer
MCQ 1451 Mark
………… catch blocks can be there from try block.
  • A
    Only one 
  • One or more 
  • C
  • D
    As many try blocks that many catch blocks
Answer
Correct option: B.
One or more 
(B) One or more
View full question & answer
MCQ 1461 Mark
…………. is the exception handler.
  • A
    Try block 
  • Catch block 
  • C
    Finally block 
  • D
    All of these
Answer
Correct option: B.
Catch block 
(B) Catch block
View full question & answer
MCQ 1471 Mark
What will happen when a try block does not generate an Exception and you have included multiple catch blocks ?
  • A
    They all execute
  • B
    Only the first matching one executes 
  • No catch block executes   
  • D
    Only the first catch block executes        
Answer
Correct option: C.
No catch block executes   
(C) No catch block executes
View full question & answer
MCQ 1481 Mark
Catch block must be ………….. .
  • A
    before try block 
  • after try  block 
  • C
    at the end of program 
  • D
    after finally block
Answer
Correct option: B.
after try  block 
(B) after try block
View full question & answer
MCQ 1491 Mark
Which of the following block handles or takes appropriate action when an Exception occurs ?
  • A
    Try 
  • Catch 
  • C
    Throws 
  • D
    Handles
Answer
Correct option: B.
Catch 
(B) Catch
View full question & answer
MCQ 1501 Mark
………… block should be there after try block.
  • A
    catch 
  • B
    finally 
  • C
    throw 
  • (A) or (B)
Answer
Correct option: D.
(A) or (B)
(D) (A) or (B)
View full question & answer