File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes array length? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "array length?" Watch "array length?" New topic
Author

array length?

darine darine
Ranch Hand

Joined: Mar 08, 2001
Posts: 43
if we an array as: int i[]=new int[10];
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.
Chris Stehno
Ranch Hand

Joined: Feb 26, 2001
Posts: 180
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)


- Chris Stehno, SCPJ
Tom Barns
Ranch Hand

Joined: Oct 27, 2000
Posts: 138
thanks for the reply,but it is still not clear for me.
any additional help will be appreciated.
thanks.


Thanks for your help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: array length?
 
Similar Threads
Performing a swap within an array
Reflection: Reading an array field
Array object ?
array size
Array documentation