File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes .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 » Beginning Java
Bookmark ".length" Watch ".length" New topic
Author

.length

William Barnes
Ranch Hand

Joined: Mar 16, 2001
Posts: 984

I know I can say ".length" on an array. Where is this defined? Can I say anything else, like ".size" maybe?


Please ignore post, I have no idea what I am talking about.
Ron Newman
Ranch Hand

Joined: Jun 06, 2002
Posts: 1056
.length is a fundamental property of any array. It's "defined" in the Java Language Specification.
Since an array is an Object, you can also call methods such as equals(), hashCode(), getClass(), notify(), wait(), etc.


Ron Newman - SCJP 1.2 (100%, 7 August 2002)
James Chegwidden
Author
Ranch Hand

Joined: Oct 06, 2002
Posts: 201
Yes, since arrays are objects .length is an instance variable.


Author and Instructor, my book
William Barnes
Ranch Hand

Joined: Mar 16, 2001
Posts: 984

> It's "defined" in the Java Language Specification.
Which is what I am asking. Is it in java.lang.*, java.io.*? Where is it?
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
http://java.sun.com/docs/books/jls/second_edition/html/arrays.doc.html
Array is not a Java class in the sense that you will find it in the API. (There is an Array class but it is part of the reflecyion API).


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
William Barnes
Ranch Hand

Joined: Mar 16, 2001
Posts: 984

Thanks - that is what I was looking for.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: .length
 
Similar Threads
About header
questions from java prepare
2 dimensional Array!
length of input stream
How to find the length of the array