JAVA array help.

Associate
Joined
8 Nov 2005
Posts
56
:confused: If anybody could point me in the right direction as to why I cannot do this.

Code:
int valueOfCoin = validCoins[index].getValue( );

validCoins is a valid array and index is a valid variable containing a number that chooses which line of the array to get the value of.

getValue() is a method within a different class that just returns an integer.

I might not have given enough information to answer this question but anybody have any ideas?
 
Ah, it was my fault, it does work was looking at an older class file! Keeping track of which version of my class I need is a pain when working across multiple systems!
 
:confused: If anybody could point me in the right direction as to why I cannot do this.

Code:
int valueOfCoin = validCoins[index].getValue( );

validCoins is a valid array and index is a valid variable containing a number that chooses which line of the array to get the value of.

getValue() is a method within a different class that just returns an integer.

I might not have given enough information to answer this question but anybody have any ideas?

What error / warning do you get, how big is your code can you not post it here and highlight the relevant bits please.
 
Ah, it was my fault, it does work was looking at an older class file! Keeping track of which version of my class I need is a pain when working across multiple systems!

Get yourself a USB flash drive and save the files to it. That way you can load up the same project in multiple locations. Just be sure to use something like synchtoy to create backups of the drive daily.
 
Back
Top Bottom