What is the point of arrLength? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is the point of arrLength?

7th Aug 2017, 12:02 PM
Humza Yusuf
Humza Yusuf - avatar
4 Answers
+ 3
To get the size of the array.
7th Aug 2017, 12:28 PM
Hassie
Hassie - avatar
+ 3
an example would be if you needed to output all elements of the array. String[] arr = {"A","B","C"} for (int i=0;i < arr.length;i++) { System.out.println(i); }
7th Aug 2017, 12:49 PM
Hassie
Hassie - avatar
+ 2
thank you! that helped. sorry for the delayed reply
8th Aug 2017, 1:43 PM
Humza Yusuf
Humza Yusuf - avatar
+ 1
could you give me an example? if we are trying in the size of it then why do we need to get the size of it?
7th Aug 2017, 12:45 PM
Humza Yusuf
Humza Yusuf - avatar