Questions · Page 2 of 4

MCQ

MCQ 511 Mark
Which is a kind of default catch block?
  • catch (Exception eobj)
  • B
    catch (default)
  • C
    catch (last)
  • D
    catch (end)
Answer
Correct option: A.
catch (Exception eobj)
catch (Exception eobj)
View full question & answer
MCQ 521 Mark
Which of the following catch block can handle any type of exception?
  • catch (Exception eobj)
  • B
    catch (default)
  • C
    catch (last)
  • D
    catch (end)
Answer
Correct option: A.
catch (Exception eobj)
catch (Exception eobj)
View full question & answer
MCQ 531 Mark
Which block has to be placed at the end of all catch blocks when there are multiple catch blocks in a program?
  • Default
  • B
    Last
  • C
    End
  • D
    Final
Answer
Correct option: A.
Default
Default
View full question & answer
MCQ 541 Mark
If which of the following block throws several different kinds of exceptions, we can write multiple catch blocks, each handling specific type of exception?
  • try
  • B
    catch
  • C
    finally
  • D
    throws
Answer
Correct option: A.
try
try
View full question & answer
MCQ 551 Mark
Which multiple blocks can be there to handle each type of exception separately?
  • catch
  • B
    throws
  • C
    try
  • D
    finally
Answer
Correct option: A.
catch
catch
View full question & answer
MCQ 561 Mark
In which of the following blocks should the code that may generate exception be written?
  • try
  • B
    catch
  • C
    finally
  • D
    throws
Answer
Correct option: A.
try
try
View full question & answer
MCQ 571 Mark
What may lead to an exception when we want to upload particular file to a remote computer?
  • A
    If the file is not present in our computer.
  • B
    If the computer is not connected to the network.
  • 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 581 Mark
How many exceptions can occur in a single program?
  • A
    Only one
  • B
    Five
  • C
    Two
  • Multiple
Answer
Correct option: D.
Multiple
Multiple
View full question & answer
MCQ 591 Mark
What identifies the type of exception that the block is to deal with by catch block?
  • With parameters
  • B
    Without parameters
  • C
    By giving different definitions
  • D
    None of these
Answer
Correct option: A.
With parameters
With parameters
View full question & answer
MCQ 601 Mark
In which of the following brackets the code that is to be executed to handle an exception is written?
  • { }
  • B
    ()
  • C
    < >
  • D
    [ ]
Answer
Correct option: A.
{ }
{ }
View full question & answer
MCQ 611 Mark
A catch block consists of the keyword catch followed by the following one.
  • Parameter
  • B
    Symbols
  • C
    Return type
  • D
    None of these
Answer
Correct option: A.
Parameter
Parameter
View full question & answer
MCQ 621 Mark
How many catch blocks are there for a try block?
  • A
    Three
  • B
    Two
  • C
    One
  • More than one
Answer
Correct option: D.
More than one
More than one
View full question & answer
MCQ 631 Mark
What is known as catch block if it is executed to handle an exception?
  • Exception handler
  • B
    Exception modifier
  • C
    Exception Creation
  • D
    Exception builder
Answer
Correct option: A.
Exception handler
Exception handler
View full question & answer
MCQ 641 Mark
Which block contains the code that is to be executed to handle an exception?
  • A
    finally
  • B
    try
  • catch
  • D
    throws
Answer
Correct option: C.
catch
catch
View full question & answer
MCQ 651 Mark
Which of the following block does the catch block immediately follow?
  • try
  • B
    throw
  • C
    finally
  • D
    throws
Answer
Correct option: A.
try
try
View full question & answer
MCQ 661 Mark
Which block has to be there after try block?
  • A
    finally, block
  • B
    catch block
  • a Or b
  • D
    None of these
Answer
Correct option: C.
a Or b
a Or b
View full question & answer
MCQ 671 Mark
In which of the following block the part of program that may lead to runtime errors must be written?
  • A
    catch
  • try
  • C
    finally
  • D
    throws
Answer
Correct option: B.
try
try
View full question & answer
MCQ 681 Mark
What will happen if the program has no exception handler?
  • Program will be terminated.
  • B
    Will exit from the terminal.
  • C
    Computer will shut down.
  • D
    None of these
Answer
Correct option: A.
Program will be terminated.
Program will be terminated.
View full question & answer
MCQ 691 Mark
In which of the following brackets try block statements are to be written?
  • A
    { }
  • B
    ()
  • C
    < >
  • [ ]
Answer
Correct option: D.
[ ]
[ ]
View full question & answer
MCQ 701 Mark
How many Exceptions a try block may give rise to?
  • A
    One
  • B
    Three
  • One or more
  • D
    Zero
Answer
Correct option: C.
One or more
One or more
View full question & answer
MCQ 711 Mark
Each type of exception corresponds to the following one in Java.
  • A
    A class
  • A symbol
  • C
    An object
  • D
    A method
Answer
Correct option: B.
A symbol
A symbol
View full question & answer
MCQ 721 Mark
Which is the code where we want to monitor for exceptions?
  • try
  • B
    catch
  • C
    finally
  • D
    throws
Answer
Correct option: A.
try
try
View full question & answer
MCQ 731 Mark
Which block do the keywords try, catch and finally represent?
  • A
    Symbolic writings
  • Statements
  • C
    Loop
  • D
    Structure
Answer
Correct option: B.
Statements
Statements
View full question & answer
MCQ 741 Mark
Which of the following are keywords for Java Exception handler?
  • try
  • B
    catch
  • C
    finally
  • D
    All of these
Answer
Correct option: A.
try
try
View full question & answer
MCQ 751 Mark
Which keywords are used to write an exception handler?
  • A
    try
  • B
    catch
  • C
    finally
  • All these
Answer
Correct option: D.
All these
All these
View full question & answer
MCQ 761 Mark
What do we try to ensure while performing exception handling?
  • A
    The program does not terminate abruptly.
  • B
    The program does not generate unexpected output.
  • 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 771 Mark
Which kind of technique an exception handling is for managing errors?
  • Object-oriented
  • B
    Imaginary
  • C
    Arithmetic
  • D
    Symbolic
Answer
Correct option: A.
Object-oriented
Object-oriented
View full question & answer
MCQ 791 Mark
Due to which of the following exception a program to divide an integer by zero will be complied successfully but generate unexpected output?
  • A
    Logical
  • Arithmetic
  • C
    Language
  • D
    Programming
Answer
Correct option: B.
Arithmetic
Arithmetic
View full question & answer
MCQ 801 Mark
What will be the result when an integer number is divided by zero?
  • A
    zero
  • B
    One
  • Infinity
  • D
    minus zero
Answer
Correct option: C.
Infinity
Infinity
View full question & answer
MCQ 811 Mark
Which of the following packages contains a hierarchy of classes dealing with various exceptions?
  • A
    java. Lang
  • B
    java.io
  • a Or b
  • D
    None of these
Answer
Correct option: C.
a Or b
a Or b
View full question & answer
MCQ 821 Mark
What is available in Java for each type of exceptions?
  • Corresponding Exception class
  • B
    Corresponding library
  • C
    Exception class which are not corresponding
  • D
    Error exception library
Answer
Correct option: A.
Corresponding Exception class
Corresponding Exception class
View full question & answer
MCQ 831 Mark
Which reasonable message is displayed in result while we are trying to display the content of an element of an array that does not exist?
  • A
    Not found
  • B
    Not exists
  • ArraylndexOu tOf Bounds Exception
  • D
    None of these
Answer
Correct option: C.
ArraylndexOu tOf Bounds Exception
ArraylndexOu tOf Bounds Exception
View full question & answer
MCQ 841 Mark
Some time program compiles successfully but does not guarantee that the program will execute as per our expectations.” -Specify this statement.
  • A
    This statement is false.
  • This statement is true.
  • C
    It depends on Java compiler.
  • D
    It depends on Java program.
Answer
Correct option: B.
This statement is true.
This statement is true.
View full question & answer
MCQ 851 Mark
Which file shall we get if the program compiles successfully?
  • A
    .java
  • .class
  • C
    .obj
  • D
    .exe
Answer
Correct option: B.
.class
.class
View full question & answer
MCQ 861 Mark
What does Exit code 1 indicate?
  • Some problem occurred while executing the command.
  • B
    Not any problem occurred while executing the command.
  • C
    Compiled program is not of Java.
  • D
    None of these
Answer
Correct option: A.
Some problem occurred while executing the command.
Some problem occurred while executing the command.
View full question & answer
MCQ 871 Mark
Which exit code indicates that the command execution is successful?
  • A
    1
  • 0
  • C
    —1
  • D
    -
Answer
Correct option: B.
0
0
View full question & answer
MCQ 881 Mark
Which of the following indicates whether the command or the program has been executed successfully or not in the field of Computer science?
  • A
    Exit code
  • B
    Exit status
  • a Or b
  • D
    None of these
Answer
Correct option: C.
a Or b
a Or b
View full question & answer
MCQ 891 Mark
Compile-time errors are usually the mistakes of the following one.
  • Programmer
  • B
    Compiler
  • C
    Java
  • D
    None of these
Answer
Correct option: A.
Programmer
Programmer
View full question & answer
MCQ 901 Mark
What does Java compiler show if there is an error during compilation?
  • A
    The line number where error has occurred.
  • B
    The type of error.
  • 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 911 Mark
Which of the following are examples of common syntax error?
  • A
    Missing of comma (,) or semicolon (;)
  • B
    Use of undeclared variable, wrong spellings of identifier or keyword
  • C
    Mismatch of bracket
  • All of these
Answer
Correct option: D.
All of these
All of these
View full question & answer
MCQ 921 Mark
When we will not be able to crate the “.class” file?
  • If there is a syntax error in the program.
  • B
    If there is a logical error in the program.
  • C
    If there is a Math’s error in the program.
  • D
    None of these
Answer
Correct option: A.
If there is a syntax error in the program.
If there is a syntax error in the program.
View full question & answer
MCQ 931 Mark
Which file will not be able to create, if there is a syntax error in the program?
  • A
    obj
  • B
    .exe
  • .class
  • D
    java
Answer
Correct option: C.
.class
.class
View full question & answer
MCQ 941 Mark
When will we get an error if there is a syntax error in the program?
  • A
    While writing a program
  • At compilation time
  • C
    While implementing a program
  • D
    None of these
Answer
Correct option: B.
At compilation time
At compilation time
View full question & answer
MCQ 951 Mark
Which of the following is a function of compiler?
  • To convert source code to object code
  • B
    To convert object code to source code
  • C
    a and b both
  • D
    None of these
Answer
Correct option: A.
To convert source code to object code
To convert source code to object code
View full question & answer
MCQ 961 Mark
What is used to convert basic instructions of any programming language to the instructions which can be implemented by a computer?
  • A
    Translator
  • Compiler
  • C
    Converter
  • D
    Connector
Answer
Correct option: B.
Compiler
Compiler
View full question & answer
MCQ 971 Mark
What is known as the instructions which can be implemented by a computer?
  • A
    Source code
  • Object code
  • C
    Syntax code
  • D
    Native code
Answer
Correct option: B.
Object code
Object code
View full question & answer
MCQ 981 Mark
What is known as basic instructions of any programming language?
  • Source code
  • B
    Object code
  • C
    Syntax code
  • D
    Native code
Answer
Correct option: A.
Source code
Source code
View full question & answer
MCQ 991 Mark
Which kind of error conditions are created during program is classified?
  • A
    Compile-time error
  • B
    Run-time error
  • 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 1001 Mark
How many categories of error conditions are created during program is classified?
  • Two
  • B
    Three
  • C
    Four
  • D
    Five
Answer
Correct option: A.
Two
Two
View full question & answer
MCQ - Page 2 - Computer STD 12 Commerce Questions - Vidyadip