This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
if we an array as: int i=new int; the length of it will be : i.length lenght is looks like a field for the array class. but when i liiok to that class i can't find a field under that name.please any help. thanks.
Arrays are 'special cases' or 'built in objects or types' of objects ... I'm not sure how to best describe them. What array class are you looking at the java.lang.reflect.Array class? That class is for use with reflection. The length of an array is an inherent property of an array. I belive that it ended up that way as a 'clean up' from C/c++ so that it you can't overrun your arrays and you don't have to count bytes to determine the length. Hope this helps .... ------------------ Chris Stehno (Sun Certified Programmer for the Java 2 Platform)