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 a stack class in java ?
What is a pointer and does java support pointers?
What about abstract classes in java?
What is a class variable?
Is minecraft 1.15 out?
What is use of super keyword in java?
What is unicode full form?
If a method is declared as protected, where may the method be accessed?
For class CFoo { }; what default methods will the compiler generate for you>?
Is char * a string?
Where is the singleton class used?
Can we create object of static class?
What is this keyword used for?
What are the restrictions imposed on method overriding?
Can this keyword be used to refer static members?