Advertisements
Advertisements
Questions
Differentiate between the following:
length and length()
Write the difference between length and length() functions.
Distinguish Between
Solution
S. No. | length | length() |
1. | This method is used to determine the size of an array. | The length() method is used to determine the size of a string. |
2. | Example: int a[] = new int[100] | Example: Strings = "summer"; |
3. | In the above example, a.length returns 100 | In the above example, s.length() returns 6 |
shaalaa.com
Is there an error in this question or solution?