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 final?
What is the purpose of stub and skeleton?
What are thread safe functions?
Does java have a compiler?
What is the purpose of main function in java?
How we can execute any code even before main method?
Why array is used in java?
What do you understand by classes in java?
Can we have multiple classes in a single file?
What is hash code collision?
What is the difference between a break statement and a continue statement?
What is jvm? Why is java called the platform independent programming language?
Is nan false?
What is meant by class and object in java?
What is object of class in java?