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 Object and array ref Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
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