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 is difference between path and classpath?
What do you mean by an interface in java?
What is the use of object and class classes?
What is meant by call by reference?
How to call one constructor from the other constructor ?
What is the Scope of Static Variable?
What is tcp ip in java?
What is scanner in java?
What is instance means in java?
Why synchronization is important in java?
Why can't you declare a class as protected?
How many return statement are allowed in a function?
Is arraylist an object in java?
What is a void method?
How many bits is a string?