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 methods are used in Servlet?Applet communication?
Why vector class is used?
Why is serialization required?
What are streams in java 8?
What is singleton class example?
What is the difference between procedural and object-oriented programs?
What is the synonym of string?
Which programming language is most secure?
Can a class have multiple subclasses?
If we allocate the memory using 'new' & de-allocated using 'free' then what will happen?
How do I get the | symbol on my keyboard?
Explain the importance of finally over return statement?
What are the types of methodology?
What is difference between adapter class and listener?
Is java platform independent?