how and when compiler knows that the Java code throws the
checked Exception.
Answer Posted / vatsal doshi
When: At Compile Time
How: Complicated.
Checked Exceptions are those which a Java Compiler is capable of checking at compile time. These exceptions normally occur when some pre-definite methods from the Java API are used by programmer. So compiler identifies such method invocations in the code. If handled using catch, or specified in the throws clause, compiler compiles successfully. Otherwise, it shows a Compile Time Error Message of possibility of a Checked Exception
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What do you understand by garbage collection in Java? Can it be forced to run?
what is thread? : Java thread
How is garbage collection controlled?
Why do we declare a class static?
What is e java?
What is an off by one error in java?
Define iterator and methods in iterator?
What is the difference between a method and a function in alice?
How to Sort Strings which are given in List and display in ascending order without using java api.
Difference between serialization and deserialization in java?
What is the biggest integer?
Why we use protected in java?
What is a marker interface?
What is the public method modifier?
What do you mean by constructor?