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
Can singleton class be cloned?
What is class and object in java?
Explain the difference between jdk, jre, and jvm?
What do you understand by classes in java?
Why strings in java are called as immutable?
what is interface in java? Explain
Explain about the select method with an example?
How do you trim a space in java?
What is java util concurrentmodificationexception?
Why is it called buffering?
Can you call a method on a null object?
Why does java have two ways to create child threads?
Explain about exception propagation?
What is the major advantage of external iteration over internal iteration?
Where to store local variables?