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
Which is better list or arraylist in java?
What is appletviewer?
How many types of variables are there?
What is a byte string?
What is an object's lock and which object's have locks in java programming?
What are static methods?
What is a class component?
What is meant by stack and queue?
What is the program compilation process?
How do you compare values in java?
Can inner class have constructor?
What is the requirement of thread in java?
What is initial size of arraylist in java?
What if static is removed from main method?
Does java initialize arrays to zero?