Java Interview questions || difference between length and length()

Опубликовано: 25 Апрель 2026
на канале: Code Junction
379
7

#java
#javainterviewquestions
#codejunction

difference between length and length()

length:
It is the final variable applicable only for arrays.
It represents the size of the array.


length() method:
It is a final method applicable for String objects.
It returns the no of characters present in the String.