Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cannot throw exception

 
Dominic Griffin
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator






 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I test whether the numbers are out of bounds
 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic