This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Object and array ref Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Object and array ref" Watch "Object and array ref" New topic
Author

Object and array ref

Ganesh Pujar
Ranch Hand

Joined: Mar 22, 2006
Posts: 45
Hi all

How is the following statement leagal?



As the C is a ref to Object (Not an array!, and anonymous array is agned to c)
Mani Ram
Ranch Hand

Joined: Mar 11, 2002
Posts: 1140
It is valid because, in Java, an array is an object. You can even invoke the methods defined in the Object class, on an array


Mani
Quaerendo Invenietis
Ganesh Pujar
Ranch Hand

Joined: Mar 22, 2006
Posts: 45



In the above case, how can we ref x[4] using c! (i think c[4] is not possible )
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Object and array ref