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 method with example?
Define canvas?
Explain about class in java?
What is the disadvantage of java?
What is string :: npos?
Can you access non static variable in static context?
What is this () in java?
What is an example of a boolean?
What is the arraylist in java?
What are the types of exceptions?
What is the difference between notify and notifyall method?
What is hashmap and map?
I want to print “hello” even before main is executed. How will you acheive that?
Can we create an object if a class doesn't have any constructor ( not even the default provided by constructor ) ?
How do I convert a numeric ip address like 192.18.97.39 into a hostname like java.sun.com?