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


Please Help Members By Posting Answers For Below Questions

What methods are used in Servlet?Applet communication?

1652


Why vector class is used?

531


Why is serialization required?

531


What are streams in java 8?

539


What is singleton class example?

580






What is the difference between procedural and object-oriented programs?

517


What is the synonym of string?

527


Which programming language is most secure?

519


Can a class have multiple subclasses?

572


If we allocate the memory using 'new' & de-allocated using 'free' then what will happen?

582


How do I get the | symbol on my keyboard?

583


Explain the importance of finally over return statement?

598


What are the types of methodology?

498


What is difference between adapter class and listener?

487


Is java platform independent?

559