Java Exception handling MCQ with Answer for study and job interview.
Q.1: What is the latest version of Java?
A 7
B 6
C 9
D 8
Answer :- D
Q.2: JRE stands for …………………
A Java Robust Engine
B Java Required Engine
C Java Runtime Engine
D Java Runnable Engine
Answer :- C
Q. 3: JDK stands for …………………
A Java Debugging Kit
B Java Development Kit
C Java Documentation Kit
D Java Database Kit
Answer :- B
Q. 4: To compile and execute Java application ……………. is needed
A JDK
B JRE
C JME
D JEE
Answer :- A
Q.5: Which environment variable (Windows OS) is set for accessing java compiler and java interpreter at command line?
A CLASSPATH
B JAVAHOME
C PATH
D HOME
Answer :- C
Q.6: To just execute a Java application ………………. is needed at the minimum.
A JME
B JDK
C JEE
D JRE
Answer :- D
Q.7: The command for java interpreter (Windows OS) is ………….
A Javaip.exe
B Javac.exe
C Java.exe
D Javai.exe
Answer :- C
Q.8: The command for Java compiler (Windows OS) is ………….
A Java.exe
B Javacompiler.exe
C Javacomp.exe
D Javac.exe
Answer :- D
Q.9: In which folder is 32-bit JDK (Windows OS) is installed by default?
A C:\Program Files\
B C:\Windows\
C C:\Java
D C:\Program Files (x86)\
Answer :- D
Q.10: In which folder is 64-bit JDK (Windows OS) is installed by default?
A C:\Program Files\
B C:\Windows\
C C:\Java
D C:\Program Files (x86)\
Answer :- A
Q.11: ……….. Occur at Runtime.
A Error
B Exception
C Trigger
D None of the above
Answer :- B
Q.12: Runtime error is also called as …………..
A Error
B Compiler error
C Exception
D None of the above
Answer :- C
Q.13: Syntax error yields into a …………
A Runtime error
B Exception
C Compiler error
D All of the above
Answer :- C
Q.14: Dividing an integer by zero yields into a ………..
A Compiler error
B JVM error
C Nothing
D Exception
Answer :- D
Q.15: A missing semi-colon for an instruction yields into a ………….
A Exception
B Runtime error
C Compiler error
D JVM error
Answer :- C
Q.16: What will be the output?
class Program {
public static void main(String args[]) {
String ar = new String[1];
ar[2] =“Ram”;
System.out.println(ar[0]);
}
}
A Compiler error
B Exception
C No error
D JVM
Answer :- B
Q.17: An exception can occur when …………..
A ‘throw’ is called
B Abnormal code is executed
C Asynchronous error happen
D All of the above
Answer :- D
Q.18: …………. helps in avoiding runtime crash of a program.
A Error handling
B Exception handling
C Compiler handling
D Database handling
Answer : B
Q.19: Which of the following is not a keyword?
A Throw
B Throws
C throwing
D Try
Answer : C
Q.20: Which of the following is not a keyword?
A Try
B Catch
C except
D Finally
Answer : C
Q.21: How to raise an exception?
A throws
B Throw
C except
D Raise
Answer : A
Q.22: Who handles unhandled exceptions?
A JVM
B OS
C catch
D finally
Answer : B