aspose file tools*
The moose likes Beginning Java and the fly likes Converting int array to string - won't recognise variable? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Converting int array to string - won Watch "Converting int array to string - won New topic
Author

Converting int array to string - won't recognise variable?

Stephanie Keeler
Greenhorn

Joined: Jan 04, 2010
Posts: 6
Could someone please tell me what I've done wrong? I've written a method to take an integer array from main and process it into a string. But every time I try to compile, it tells me that the variable used in the for loop 'can't be found'.



Every time I get the error message

TestRun.java:40: cannot find symbol
symbol : variable eCount
location: class TestRun
sBuff.append(theArray[eCount]);
^
1 error



eCount is what I re-named it to, in case the naming was a problem. What's going on, and what have I done? (or not done!)
James Tharakan
Ranch Hand

Joined: Aug 29, 2008
Posts: 580

for (int eCount=0; eCount<theArray.length; eCount++);


remove the semicolon in this statement>


SCJP 6
Why to worry about things in which we dont have control, Why to worry about things in which we have control ! !
Stephanie Keeler
Greenhorn

Joined: Jan 04, 2010
Posts: 6
Once again, I feel really stupid. Thank you very much for the help!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Converting int array to string - won't recognise variable?
 
Similar Threads
May code writing style affect the grade?
String replaceAll
Calling a method
location of array element
Generics and method compareTo giving me a warning