Q. What is the difference between length and length()?
==========================================================================
-> length is a final variable, applicable only for arrays.
whereas length() is a method, applicable only for String object.
-> length variable represents the size of array.
whereas length() returns the number of characters present in String.
==========================================================================
-> length is a final variable, applicable only for arrays.
whereas length() is a method, applicable only for String object.
-> length variable represents the size of array.
whereas length() returns the number of characters present in String.
Comments
Post a Comment