Advertisements
Advertisements
प्रश्न
Differentiate between the following:
length and length()
Write the difference between length and length() functions.
फरक स्पष्ट करा
उत्तर
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
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?