Results 1 to 2 of 2
  1. #1
    simorgh is offline Member
    Join Date
    Jan 2010
    Posts
    25
    Rep Power
    0

    Default throws exception

    There are times when it makes sense for a program to deliberately throw an exception. This is the case when the program discovers some sort of exceptional or error condition, but there is no reasonable way to handle the error at the point where the problem is discovered. The program can throw an exception in the hope that some other part of the program will catch and handle the exception.
    Java Programming: Section 9.3

    May someone give me simple example of such case?

  2. #2
    al_Marshy_1981 is offline Senior Member
    Join Date
    Feb 2010
    Location
    Waterford, Ireland
    Posts
    748
    Rep Power
    5

    Default

    handling user input, file access, anything that is basically is outside the programmers fault :D

Similar Threads

  1. JButton: getLocationOnScreen() throws Exception
    By ExceptionHandler in forum AWT / Swing
    Replies: 10
    Last Post: 02-15-2010, 02:38 PM
  2. Applet throws exception while recording
    By Basit56 in forum Java Applets
    Replies: 1
    Last Post: 08-20-2009, 02:42 PM
  3. Exception throws when I read File
    By Juggler in forum New To Java
    Replies: 11
    Last Post: 08-18-2008, 07:09 PM
  4. Main method with throws Exception
    By bugger in forum New To Java
    Replies: 3
    Last Post: 01-07-2008, 03:48 PM
  5. throws Exception
    By javaplus in forum New To Java
    Replies: 1
    Last Post: 11-06-2007, 08:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •