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 meant by Garbage collection?
What is a pointer and does java support pointers?
Is arraylist ordered?
What is difference between string and stringbuffer?
How will you calculate the depth of a binary tree if the tree contains 15 nodes?
What is final variable?
Write a java program to check if a number is prime or not?
Can you explain the usages of class.forname()?
What is nested class?
Explain about the security aspect of java?
What is the epoch date?
How to sort an array in java without using sort method?
What is java reflection?
What is the difference between Java and C++?
What is mean by collections in java?