I think I still don't understand. :-(

The compile-time behaviour is well documented in JLSv3 6.4.5.

But where is the run-time behaviour documented?
Isn't the javadoc of class Object a good place?

With the term 'spec' you mean the JLS or the javadoc of class Object?

-Ulf


Am 04.09.2010 01:34, schrieb Martin Buchholz:


On Fri, Sep 3, 2010 at 16:13, Ulf Zibis <ulf.zi...@gmx.de 
<mailto:ulf.zi...@gmx.de>> wrote:

      ,

    the whole enclosing paragraph talks about class, object and instance, so 
why talk about type
    for the array case?


Because the array types don't have their own javadoc, there is no other obvious place to document the compile-time behavior of this method for the class for e.g. int[].


To be more precise, (but still hand-waving...), it is *as if* every array type X has an override for clone that looked like this:

class X {

@Override X clone() { return (X) super.clone(); }

}

There is some value putting in the pseudocode above into the spec, but it is hard to do because it's not actually legal java code, and there is no 1-1 correspondence from array types to classes.

Java does not have "self" types.

Reply via email to