L
L
Li_Von2017-05-19 12:20:56
Java
Li_Von, 2017-05-19 12:20:56

What is the problem with the length method?

Here is the code snippet:
String aff = args[0];
int b = aff.lenght() - 1;
When compiling, it gives the following error:
NON.java:4: error: cannot find symbol
int b = aff.lenght() - 1;
^
symbol: method length()
location: variable aff of type String
1 error
Thanks in advance!)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question