Java Interview Question And Answer 35 Java Exception Interview Question Part 1
1,064 views · Published 28 November 2013 · 5:43 · Indexed 6 November 2026
Channel: Interview DOT · 2013 · Science & Technology
Click here - https://www.youtube.com/channel/UCd0U_xlQxdZynq09knDszXA?sub_confirmation=1 to get notifications. Java Interview Question And Answer 35 Java Exception Interview Question Part 1
1.What is an Exception ?
Exception is abnormal condition that can be handled .In Other Word An unwanted, unexpected event that disturbs normal flow of the program is Exception.
2. What is an Error ?
The Abnormal condition that can't be handled that is called error . Ex [System failure,JVM Shutdown]
3. What is the purpose of Exception handling ?
The main purpose of Exception of handling is for graceful termination of the program.
4. What is meaning of Exception handling ?
Exception Handling dosen't mean repairing the exception we have to define alternative way to continue the rest of code normally.
5. What is the purpose of the try block ?
We should maintain the risky code inside try block.
6. What is the purpose of the catch block ?
We have maintain all the Exception handling code in side the catch block.
7. What is try ?
Some time interviewer might ask this type of question and try to confuse you but don't confuse, answer is so simple try is a key word in java.
8. What is catch ?
Same case as a try catch is also key word in java.
9. Is try block with multiple catch Block possible?
Yes its possible You can Write a try block with multiple catch block for separate catch block for every exception.
Ex. try{
risky code;
}Catch(IOException e){
}Catch(ArithmaticException e){
} etc.
10. If try multiple catch block present is order of catch block is important in which order we have to take?
If try has multiple catch block ,then the order of catch block is important it should from child to parent not parent to child.
11. what are the various method in Exception class ?
There are various method in Exception class
printstackTrace() :- This Method print exception information in the following format. Name of the Exception Description StackTrace
toString() This method print information in the following format. Name of the Exception Description
getMessage() This method print only description of the exception
12. If an exception raised in catch block what will happen ?
If an Exception raised in catch block and it is not part of any try block then it is always abnormal termination.
More from this channel
-
7:19
java pass by value
-
3:19
java interview best books
-
8:03
Explain java finally block
-
4:29
what are the advantages of OOPL Java Interview
-
2:40
what is java decompiler how to decompile java code
-
5:51
Top 4 Job Interview Tips How to prepare for Job interview
-
5:29
Top Job Interview TIPS What are your strengths How to answer
-
3:49
Top 16 Job Interview Questions Best Job Interview Questions