Just wondering what gives an array of primitive type its "length" property? i.e. when I have - int arr = new int; How is the call arr.length resolved by the compiler, as type of array here is int? TIA, - Manish p.s. I hope I am not flooding the forum with silly questions.
Hey Manish the compiler uses a special bytecode to get the length of an array objetc: arraylength. Though the length of an array is a field of the array object, compiler doesn't use the normal getfield or getstatic bytecodes: