Answer the question
In order to leave comments, you need to log in
What could be wrong with accessing the .lenght field of a simple array?
Help, please, deal with the .lenght field. I can't count the number of elements. I can't figure out what I'm doing wrong.
Code example:
public class Phrase{
public static void main (String[] args) {
String[] dou = {"abc", "abcd", "adcde", "abcdef"};
intx;
x = dou length;
}
}
Error
Phrase.java:6: error: cannot find symbol
x = dou.lenght;
^
symbol: variable length
location: variable dou of type String[]
1 error
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question