Originally posted by I moussa: i am not sure if this is part of code is right or wrong ! so if any one can tell me ? " the Try and catch part "
I added IllegalArgumentException in else part because in earlier code IllegalArgumentException was not getting thrown ATALL from try block. Hence I made sure that when Arguments are incorrect throw new exception. IllegalArgumentException is runtime exception.
Originally posted by Vishal Matere: ... Will not this throw Exception?
Sorry, my response was to the original poster. I did not see your reply until after I had posted.
Joined: Mar 20, 2008
thanks Campbell Ritchie for the advise , i do know it already but my prof takes points off because some thing like this if (!invalideSize(size)) is not clear enough:S, Stevi Deter well i thought so that nested catches wont work, i never actually had to do nested catches before so i am just trying to get the best of it ..