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 variable argument in java?
Can a static method be final?
How do you reverse a string in java without using string buffer?
What is a variable declaration?
What is token in java?
What is a stack class in java ?
What do u mean by variable?
What happens if an exception is throws from an object's destructor?
Why pass by reference is not possible in java?
What is difference between equals and hashcode method?
What are different types of multitasking?
Is java code slower than native code?
Why is java called java?
What are thread priorities and importance of thread priorities in java?
Explain notify() method of object class ?