Results 1 to 1 of 1
Thread: java Array.length property
- 04-07-2010, 08:45 AM #1Member
- Join Date
- Feb 2010
- Rep Power
java Array.length property
[Edit] let me explain better:D
If you create an array of primitive types for example:
int foo = new int;
You can call the property .Length on this array. I wanna know how that is possible? Where does the length property come from? I know its not from Object and i know there isnt a "real" Array class...
Anyway i was discussing it with people and what we think that happens is that the compiler implicitly creates an array object with a length property for you. But we arent sure, we couldnt find another way to explain it. Anyway we want to be sure the happens, or something else happens.
One of the things is, if its implicitly done, will it be compile time or runtime since you might not know the length at compiletime yet...
Anyway i hope somebody can help me.
Last edited by X-ion; 04-07-2010 at 03:46 PM.
- By nicolek808 in forum New To JavaReplies: 4Last Post: 09-10-2009, 09:12 AM
- By mindyyong in forum Jobs OfferedReplies: 0Last Post: 06-25-2009, 05:28 AM
- By Java Tip in forum java.langReplies: 0Last Post: 04-23-2008, 08:15 PM
- By Java Tip in forum java.langReplies: 0Last Post: 04-14-2008, 08:42 PM
- By suloverboy in forum New To JavaReplies: 3Last Post: 12-14-2007, 09:31 PM