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 difference between char and char *?
What is the indent key?
Is it possible to use Semaphore/ Mutex in an Interrupt Handler?
What is use of inner class in java?
Give a brief description of java socket programming?
What is main difference between variable and constant?
What is map in java?
Is space a char?
What is increment in java?
How is hashcode calculated in java?
How to write custom exception in java?
Explain when classnotfoundexception will be raised ?
How does the java compiler work?
In how many ways we can do exception handling in java?
How do you compare objects in java?