Difference between length and length( )

  • length variable is used to calculate size of array.
  • length() method is use to calculate size of string. Returns number of chars present in String.

Output:

Help others by sharing the content!

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.