On Aug 2, 5:22 am, JKid314159 <[email protected]> wrote:
> I try to post to group but forget when sending.  Sorry.
>  
> I got it working with putting the number into the message.
There is also the possiblity to add a variable in the Exception class
so that you can use it in the message to get to the number. Actually
as you extends the class, you may put what you want in it which seems
convenient to you, any other variable (constructor is needed in this
case), any other method, etc.
>  But when the negative number is very large like -2738484349093093204 this 
>throws a numberformatexcept and ignores mynegativeexception.  This is too 
>large for memory.  Do I fix this or leave like this?
For your future coding, it is better to fix it, you may catch it, for
example, within printDiamond, giving the size an upper limit and
throwing here a RuntimeException (I put 20 as limit here).

--~--~---------~--~----~------------~-------~--~----~
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