File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA 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