Well ! I have a confusion.When we find length of an array we just use a.length; but to find length of an string we use S.length();.Why paranthesis are not used in case of array,however to call any method we use paranthesis?
paranthesis use
Collapse
X
-
arrays are static, fixed length you have to declare the length first. Therefore you can easily get the .length of an array (primitive). Where as of strings you need to count the char with in the string class(think blob) to get the count or length() (method) of a string.
don't confuse the ArrayList() with standard Array[]; they are similar but ArrayList() is a class and Array[] is more primitive.
hope this helps.Comment
Comment