"cannot find symbol" error when trying to use the getInt() method.
I am trying to obtain something from an array and when I compile it tells me "cannot find symbol. "
Code :
public int numberOfAccesses()
{
int total = 0;
int index = 0;
hourCounts.getInt(hourCounts, 24);
....... hourCounts = new int[24]; //this is how it is declared in the instance field.
I'm not sure what I am doing wrong, any help would greatly appreciated, thanks.
Re: "cannot find symbol" error when trying to use the getInt() method.
Quote:
"cannot find symbol. "
Can you post the full text of the error message the shows what can not be found and other important info about the problem.
Re: "cannot find symbol" error when trying to use the getInt() method.
Sorry - "cannot find symbol - method getInt(int[],int)"
I'm trying to write a method that will allow me to access the hourCounts array.
Re: "cannot find symbol" error when trying to use the getInt() method.
The compiler can not find a definition for a getInt() method that takes an int array and and int as args defined for the variable: hourCounts. If hourCounts is an array, there is not a getInt() method for arrays.
What class is getInt() defined in? What is the statement with the error supposed to do?
Quote:
trying to write a method
See the tutorial:
http://docs.oracle.com/javase/tutori...O/methods.html
Re: "cannot find symbol" error when trying to use the getInt() method.
Oh I was mistaken the Array class for the Arrays class. After looking into the arrays class I tried doing a binarySearch() and got the same error. All I was trying to do was access info from an index in my array. I have had no problems with retrieving data from an arraylist but using the an array is confusing me. Thanks for the quick replys.
Re: "cannot find symbol" error when trying to use the getInt() method.
Quote:
using the an array is confusing
You access an array by using the name of the array, some [] and an index value:
theArray[theIndex] // access the element at theIndex in theArray
Re: "cannot find symbol" error when trying to use the getInt() method.
It turns out it is an ArrayType Class. I have so much to learn. Thanks for the help.