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 java ide should I use?
Does java allow default arguments?
What is public static?
How to set the permissions to a file in java?
What is a function easy definition?
What is the use of protected in java?
Is a method a procedure?
Can we override private methods?
Explain java code for recursive solution's base case?
What is floor math?
Is age a discrete variable?
When to use runnable interface vs thread class in java?
What is meant by inheritance and what are its advantages?
What is difference between this and super keyword?
Why can't we make a class private in java?