Question: what is the difference between length and length() in java?
Answer: length() method returns the number of characters presents in the string. The length variable is applicable to array but not for string objects whereas the length() method is applicable for string objects but not for arrays. To directly accesses a field member of array we can use .