Click to See Complete Forum and Search --> : array length


MadamZuZu
05-12-2006, 04:54 PM
hi.
i keep getting this error. please help

"java cannot invoke length() on the array type char[]"

this is the line of code

length = phone.length();

Thanks!

sridhar_423
05-14-2006, 06:44 AM
length = phone.length;

agent_x91
05-18-2006, 05:09 PM
as sridhar says. The thing to remember is that the length of a String is a function, but the length of an array is a variable.

a_string.length() but an_array.length