6. For your own exercise, modify Diamond.java so that the a number that is
greater than 20 generates AssertionError
Modified CODE for AssertExample ( *the problem is that it does not display
the second block of statement while run, can anyone tell me the right thing?
*)
modified code:
try{
assert(size < 20);
printDiamond(size);
}catch(AssertionError c){
JOptionPane.showMessageDialog(null,"Assertion error is
captured:Size should be<20");
}
System.exit(0);
try{
assert(size > 0);
printDiamond(size);
}catch(AssertionError e){
JOptionPane.showMessageDialog(null,"Assertion error is captured:
Size should be >0");
}
Thanks in advance.
Antara
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---