aspose file tools*
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


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "int[1000]" Watch "int[1000]" New topic
Author

int[1000]

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?

Thanks,

Layne


Java API Documentation
The Java Tutorial
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: int[1000]
 
Similar Threads
Where to ask questions about cattledrive assignments?
Finding a prime factor
number to text convertion
NumberFormatException
Pulling Integer Values from a String