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 merge sort in java?
What is the purpose of the strictfp keyword?
What is number data type in java?
Explain jvm, jre, and jdk?
What is exception handling in java?
What is meant by oops concept in java?
Is null false in java?
How do you create a bulleted list?
What is internal iteration in java se 8?
What is the use of System class?
What is the java reflection api? Why it’s so important to have?
Which are different kinds of source code?
Can we use a default constructor of a class even if an explicit constructor is defined?
What is set and get methods in java?
Can I extend singleton class in java?