AceTheInterview
Jobs in Pune | Work better in teams | Socialize with friends | Submit Q&A | Tell a friend
Search site for 

Top 100 Interview Questions & Answers in a convenient and easy to read book!

“I bought this guide a few days ago to prepare for my interview with Oracle. Many of the questions they asked me were from this guide. I found this book absolutely great!”

– Ravi, California

Read more comments...

Interview Questions And Answers RSS Feed

Answers »

  1. Submitted By: arulmaria — October 6, 2006
    +14 votes
      + -

    1.It separates the working/functional code from the error-handling code by way of try-catch clauses.

    2.It allows a clean path for error propagation. If the called method encounters a situation it can’t manage, it can throw an exception and let the calling method deal with it.

    3.By enlisting the compiler to ensure that “exceptional” situations are anticipated and accounted for, it enforces powerful coding.

    4.Exceptions are of two types:
    Compiler-enforced exceptions, or checked exceptions

    Runtime exceptions, or unchecked exceptions

    Compiler-enforced (checked) exceptions are instances of the Exception class or one of its subclasses — excluding the RuntimeException branch. The compiler expects all checked exceptions to be appropriately handled. Checked exceptions must be declared in the throws clause of the method throwing them — assuming, of course, they’re not being caught within that same method. The calling method must take care of these exceptions by either catching or declaring them in its throws clause. Thus, making an exception checked forces the us to pay heed to the possibility of it being thrown. An example of a checked exception is java.io.IOException. As the name suggests, it throws whenever an input/output operation is abnormally terminated.

  2. Submitted By: Abhishek Dutta Roy — July 25, 2007
    -1 votes
      + -

    Exceptions are special conditions in a program that leads to abnormal termination of the program. The most common exception is “divide by zero”.
    Exception in java can be handled by following methods:
    try and catch
    throw
    throws
    finally

  3. Submitted By: Shemi — September 30, 2008
    -1 votes
      + -

    An exception is an error situation that terminates a program abnormally…

    u already read about checked exceptions.. these situations are checked during compilation and hence need to handled or declared to be thrown(using ‘throws’ keyword)

    then there are unchecked exception which are checked only runtime.
    eg ArrayIndexOutOfBoundException, ArithmeticException…
    When such an error occurs, compiler will search for its handling code. If not found, eventually the JVM(Java virtual machine) handles the error.

  4. Leave an Answer/Comment

    To prove you're a person (not a spam script), type the security text shown in the picture. Click here to regenerate some new text.
    Click to hear an audio file of the anti-spam word

Our Sponsors
Our Sponsors
Contact Us | FAQ | Sitemap | Terms of Use | Privacy Policy | Tell a Friend

Copyright © 1999-2006 Jeeve Technologies LLC. All rights reserved.