File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Are arrays objects in Java? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Are arrays objects in Java?" Watch "Are arrays objects in Java?" New topic
Author

Are arrays objects in Java?

Lokanadham Nalla
Greenhorn

Joined: Jul 21, 2005
Posts: 7
Hi,

I read in some book as "Arrays are objects in Java" and also "All arrays of reference type are subtypes of the array type Object[], but arrays of primitive data types are not. Note that the array type Object[] is also a subtype of Object type".

How is the first statement "Arrays are onjects in Java" true for primitive type arrays? Are primitive type arrays not objects?

Thanks,
Loka
Surasak Leenapongpanit
Ranch Hand

Joined: May 10, 2002
Posts: 341
The arrays are objects in JAVA including primitive type arrays, See JLS
Marcus Green
arch rival
Rancher

Joined: Sep 14, 1999
Posts: 2813
All arrays (the thing that contains the elements) are Objects. The elements of an array (what an array contains), may be either an Object or a primitive.


SCWCD: Online Course, 50,000+ words and 200+ questions
http://www.examulator.com/moodle/course/view.php?id=5&topic=all
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Are arrays objects in Java?
 
Similar Threads
Array Conversion
Q26 Exam Marcus03
Assign two dimensional string array to one dimensional object array
Is java fully OOPS??
Arrays belong to which class