On Aug 27, 9:40 am, TheIrda <[email protected]> wrote: > Hi all, > > I think there are some issues on 1007_javase_exceptions, > ExperienceException project ( with JDK 6). This is on purpose. The goal of the lab is learn exceptions, so it is up to you to transform the code so that it effectively gives the right exception and to catch it. It is possible. Search the forums, there are solutions in it.
Michèle Garoche > > The Exception throwned by the application is always a > NullPointerException as the double[] a has not been initialized, so > accessing a[1] cause this exception instead of expected ones. > > I also experience the following behaviours : > > 1 - DividebyZero, with double I get a result of Infinity instead of > exception... The exception is thrown if I do it with int. > 2 - with Math.sqt(-1), a[1] becomes NaN and does not throws > exceptions. On Javadoc I can see the following for Math.sqrt : > > Returns: > the positive square root of a. If the argument is NaN or less than > zero, the result is NaN. > > 3 - I'm not even able to get Overflow Exception. Even if I do > something like : > > int b = Integer.MAX_VALUE + 2, I do not get na exception, and ptinting > b give negative number ( due to the overflow putting the sign bit at > 1 ). > > Regards, > Mirko -- 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
