aspose 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
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply 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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Object and array ref
 
Similar Threads
String syntax
Array is instance of an Object? No API in JavaDocs
How to get current paragraph number
Widening Reference Conversation
Doubt in arrays