A little theoretical confusion | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

A little theoretical confusion

java has a string function named length() calculating length of string but what is length in array.length?an object or datatype?

14th Apr 2020, 8:13 PM
CRAZY - OTK
CRAZY - OTK - avatar
2 Answers
0
array.length is class member constant of array and its datatype is int, int[] a = {1,2,3,4,5}; byte len = a.length; // error: lossy conversion from int to byte array itself internally is object
15th Apr 2020, 2:48 AM
zemiak
0
~ swim ~ does that read-only property have any specific name?
15th Apr 2020, 4:12 AM
CRAZY - OTK
CRAZY - OTK - avatar