Advantages of Exceptions in JAVA


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Advantages of Exceptions in JAVA

  1. #1
    Join Date
    Mar 2006
    Posts
    16

    Question Advantages of Exceptions in JAVA

    hi friendz ,

    Can anybody tell me what are the advantages of exception in JAVA?

    Regards,
    Rohan Chandane

  2. #2
    Join Date
    Dec 2005
    Location
    New Jersey
    Posts
    290

  3. #3
    Join Date
    Dec 2004
    Location
    San Bernardino County, California
    Posts
    1,468
    Exceptions let you know when an exceptional event - something unexpected, something which is an error in execution - has occurred. It gives you the opportunity to rescue your program so it can continue to execute - if possible. It allows you to demonstrate your ability to think about the expectations of your user, and to live up to your responsibility to those users. Appropriate use of exceptions is a sign of your commitment to the art and the science of programming.

  4. #4
    Join Date
    Jan 2006
    Location
    Sydney
    Posts
    49

    Checked VS Unchecked

    In addition to what nspils said:

    Due to heavy use of checked exceptions and minimal use of unchecked exceptions, there has been a hot debate in the Java community regarding true value of checked exceptions. Use checked exceptions when the client code can take some useful recovery action based on information in exception. Use unchecked exception when client code cannot do anything. For example, convert your SQLException into another checked exception if the client code can recover from it and convert your SQLException into an unchecked (i.e. RuntimeException) exception, if the client code cannot do anything about it.
    Arul

Similar Threads

  1. Replies: 2
    Last Post: 06-14-2006, 04:16 PM
  2. Java vs. .Net. A questionnaire
    By Basil in forum .NET
    Replies: 1
    Last Post: 05-13-2005, 07:46 AM
  3. DevX does seem one sideded
    By Rob Abbe in forum Talk to the Editors
    Replies: 44
    Last Post: 01-13-2003, 03:57 PM
  4. learning c# very confusing.
    By Mike Tsakiris in forum .NET
    Replies: 11
    Last Post: 10-04-2002, 06:32 PM
  5. Re: VB vs. Visual Age for Java
    By JJ in forum Enterprise
    Replies: 1
    Last Post: 07-06-2000, 05:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center