Also worth noting that the exercises use the BufferedReader class

http://java.sun.com/j2se/1.4.2/docs/api/java/io/BufferedReader.html

which is part of Java.io and some of the methods "throw" (if something
throws and exception it must be handled) an IOException error which
has to be handled in some way. If you use netbeans it will ask you to
either add a try-catch block or "throws" thing when calling the
BufferedReader method

The homework doesn't use this class so the try catch stuff isn't
required for the code to compile.  The section on Exception handling
with cover this I guess.

So I agree it's good to have it but not for this homework


Jas

On Aug 20, 6:56 am, miga <[email protected]> wrote:
> On Aug 20, 7:52 am, Don <[email protected]> wrote:> In the lead up discussions 
> prior to the homework exercise, we are told
> > to use a try{catch{}} as part of using the BufferedReader method.
> > When we move on to the JOptionPane method, the example in the exercise
> > before the homework part does not include any try{catch{}} type
> > mechanism.  I am wondering if this is an error,
>
> No, this is not an error, this is only to simplify things, but in a
> real program you should catching any possible errors.

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to