Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


how and when compiler knows that the Java code throws the
checked Exception.

Answers were Sorted based on User's Feedback



how and when compiler knows that the Java code throws the checked Exception...

Answer / aruna

Checked or caught exceptions are those exceptions that the
application programmer created a catch block to handle them.
while compiling, the java compiler make sure that all the
checked exceptions must be caught by the applicaion
programmer.Those exceptions are called the application or
business logic exceptions.

Inside the method body, there are calls to other methods;
the compiler looks at each of their method signature, what
exceptions they declared to throw. There are two
possibilities, either exceptions are caught inside the
caller-method by a try-catch block, or the caller declares
to throw the exception to its caller.

Is This Answer Correct ?    18 Yes 4 No

how and when compiler knows that the Java code throws the checked Exception...

Answer / 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

More Core Java Interview Questions

StringBuilder s = new StringBuilder("Hello Mom");s.append(",I mean,Mother"); Response.Write(s.ToString()); String s = "Hello Mom"; s+ = ",I mean Mom"; Response.Write(s); Which is faster ? which uses the most memory?

6 Answers   HCL,


What is the size of boolean variable?

0 Answers  


why abstract class will have a constructor?

4 Answers  


How to perform merge sort in java?

0 Answers  


Explain the differences between public, private, protected and static?

4 Answers  


Are arrays static in java?

0 Answers  


What is the difference between heap memory and stack memory?

0 Answers   Aspiring Minds,


What is an example of character?

0 Answers  


What are keyboard events?

0 Answers  


Where are variables stored?

0 Answers  


Define an abstract class with reference to java.

0 Answers  


Can classes declared using the abstract keyword cab be instantiated?

0 Answers   MCN Solutions,


Categories