Computer Applications
Differentiate between length and length()
Java Arrays
ICSE 2010
101 Likes
Answer
length | length() |
---|---|
length is an attribute i.e. a data member of array. | length() is a member method of String class. |
It gives the length of an array i.e. the number of elements stored in an array. | It gives the number of characters present in a string. |
Answered By
63 Likes