Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

The Mysterious java array implementation

807589Oct 22 2008 — edited Oct 22 2008
In java when we create an array of primitive data type

e.g long[] x = new long[10];

we can reterieve the lenght of the array using x.length. Does someone know where this variable length is declared. As in java arrays are implemented as an Objects. Even i treid to find out the class reference variable "x" belongs to, and I came to know that it is "[J" and this class implements Cloneable and Seriaziable interface. But there is no field or variable like "length".
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 19 2008
Added on Oct 22 2008
4 comments
242 views