On Mar 27, 12:09 am, Rafał Laczek <[email protected]> wrote: > Hello, > > In my homework over Diamond class I have created following class: > > class MyOwnZeroValueEnteredException extends ArithmeticException{ > > } > > In main class my try-catch is following: > try { > printDiamond(size); > > } catch (MyOwnZeroValueEnteredException e) { > if (size<0){ > JOptionPane.showMessageDialog(null, " Size should be >0. There is: > "+size); > > } > } > > I have a problem to display entered negative value. > > Please help! Respective exception handler will not be entered unless there is an exception that matches its type. Therefore, you have to throw an exception. It can be thrown either in printDiamond() or in the try block. > > Best regards, > Rafał Laczek > > ---------------------------------------------------- > Zrób karierę jak Top Modelka Anna Jagodzinska! > Wygraj kontrakt na 300 000 USD! Zostań modelką NEW AGE MODELS! > Więcej > informacjihttp://klik.wp.pl/?adr=http%3A%2F%2Fcorto.www.wp.pl%2Fas%2Fnewageface...
--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
