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!