how and when compiler knows that the Java code throws the
checked Exception.
Answer Posted / aruna
Checked or caught exceptions are those exceptions that the
application programmer created a catch block to handle them.
while compiling, the java compiler make sure that all the
checked exceptions must be caught by the applicaion
programmer.Those exceptions are called the application or
business logic exceptions.
Inside the method body, there are calls to other methods;
the compiler looks at each of their method signature, what
exceptions they declared to throw. There are two
possibilities, either exceptions are caught inside the
caller-method by a try-catch block, or the caller declares
to throw the exception to its caller.
| Is This Answer Correct ? | 18 Yes | 4 No |
Post New Answer View All Answers
What is the multi-catch block in java?
What is difference between final and finally in java?
What are the types of java?
What's the purpose of using break in each case of switch statement?
What are the basics of core java?
Does java support multiple inheritance or not?
What is the advantage of preparedstatement over statement?
List some oops concepts in java?
Why we go for collections in java?
Explain exception chaining in java?
Explain try and catch keywords in java?
When super keyword is used?
How do you reverse sort a list in java?
Explain about the performance aspects of core java?
Why string is not thread safe?