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 merge sort in java?

568


What is the purpose of the strictfp keyword?

600


What is number data type in java?

538


Explain jvm, jre, and jdk?

545


What is exception handling in java?

561






What is meant by oops concept in java?

492


Is null false in java?

692


How do you create a bulleted list?

547


What is internal iteration in java se 8?

613


What is the use of System class?

594


What is the java reflection api? Why it’s so important to have?

543


Which are different kinds of source code?

644


Can we use a default constructor of a class even if an explicit constructor is defined?

635


What is set and get methods in java?

528


Can I extend singleton class in java?

611