File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

array length?

 
darine darine
Ranch Hand
Posts: 43
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 180
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)
 
Tom Barns
Ranch Hand
Posts: 138
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the reply,but it is still not clear for me.
any additional help will be appreciated.
thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic