6 Replies Latest reply: Jan 28, 2009 5:16 AM by 843785 RSS

    IOException

    843785
      i'm not quite sure what they are and why they are use in programs.
        • 1. Re: IOException
          800282
          That class [signals that an I/O exception of some sort has occurred. It is the general class of exceptions produced by failed or interrupted I/O operations.|http://java.sun.com/j2se/1.4.2/docs/api/java/io/IOException.html]
          • 2. Re: IOException
            796447
            An IOException occurs whenever one is unable to repay a loan.
            • 3. Re: IOException
              800725
              warnerja wrote:
              An IOException occurs whenever one is unable to repay a loan.
              Unable to repay a loan!!! :P
              • 4. Re: IOException
                843785
                If an error occurs, an error may be thrown, and the type of error it throws may be an IOException. You can also
                make your own errors to be thrown.


                Below is an example of how to catch the error in your code.
                try {
                
                something.doThis();
                
                catch(IOException e) { System.out.print(e); }
                Edited by: KyleG on Jan 28, 2009 2:31 AM

                Edited by: KyleG on Jan 28, 2009 2:32 AM
                • 5. Re: IOException
                  PhHein
                  KyleG wrote:
                  try {
                  
                  something.doThis();
                  
                  catch(IOException e) { System.out.print(e); }
                  Then do it properly and use
                   e.printStackTrace();
                  • 6. Re: IOException
                    843785
                    Good call. If you want to show a trace of what has happened. you can show a trace from the stack and
                    show where exactly the error is coming from.

                    Edited by: KyleG on Jan 28, 2009 3:16 AM