About length and value getting from array

In array.length what actually is length and array takes constant amount of time to reach to any index ,is array works like switch and does not traverse from 0 to that index .

Hi @shubhamkumarsingh,
array is an object of a dynamically generated class. Java array inherits the Object class. That means that the properties like length is a variable defined in the class which can be accessed in constant time.If you do not know about classes in java kindly refer to the video lectures

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.