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


Please Help Members By Posting Answers For Below Questions

What is the difference between char and char *?

752


What is the indent key?

783


Is it possible to use Semaphore/ Mutex in an Interrupt Handler?

740


What is use of inner class in java?

742


Give a brief description of java socket programming?

736


What is main difference between variable and constant?

757


What is map in java?

719


Is space a char?

703


What is increment in java?

717


How is hashcode calculated in java?

704


How to write custom exception in java?

803


Explain when classnotfoundexception will be raised ?

792


How does the java compiler work?

726


In how many ways we can do exception handling in java?

766


How do you compare objects in java?

690