This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Beginning Java and the fly likes Cannot throw exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Cannot throw exception" Watch "Cannot throw exception" New topic
Author

Cannot throw exception

Dominic Griffin
Greenhorn

Joined: Jun 10, 2009
Posts: 16






pete stein
Bartender

Joined: Feb 23, 2007
Posts: 1561
You seem to be testing if the array's length is < 0 (impossible) or > 100, not whether the numbers it contains are out of bounds.
Dominic Griffin
Greenhorn

Joined: Jun 10, 2009
Posts: 16
How do I test whether the numbers are out of bounds
pete stein
Bartender

Joined: Feb 23, 2007
Posts: 1561
How do I test whether the numbers are out of bounds

By iterating through the array with a for-loop (as you already are doing), and testing each array element to see if it is in bounds or not.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cannot throw exception