jQuery in Action, 3rd edition
The moose likes Beginning Java and the fly likes int[1000] Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "int[1000]" Watch "int[1000]" New topic


Justin Porter
Ranch Hand

Joined: Nov 20, 2004
Posts: 34
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!

Want a free iPod, digital camera, or $300 cash? Completely legit offer at <a href="http://www.geocities.com/pricklymustard/freestuff.html" target="_blank" rel="nofollow">http://www.geocities.com/pricklymustard/freestuff.html</a> . I am looking for referrals which is why I need YOU!
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
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?



Java API Documentation
The Java Tutorial
I agree. Here's the link: http://aspose.com/file-tools
subject: int[1000]
It's not a secret anymore!