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

int[1000]

 
Justin Porter
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a program with an array of integers defined like so:

int[] thenumber = new int[1000];

Now, I am trying to use a specific one of those number designated in a loop like so:

while (thenumber[i] >= 10)
{
...
...
}

When I try to compile I get an error that says "']' expected" on the line of the "while" statment... why would this be, and what do I need to change to fix it? Thanks for any help!
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The code you gave here looks fine. I would guess that the actual problem occurs in the lines previous to your while loop. Can you post the whole method that contains this loop?

Thanks,

Layne
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic