Re: arrays and cloning, where is it described?




"Daniel Pitts" <newsgroup.spamfilter@xxxxxxxxxxxxxxxxxxx> wrote in message
news:47d03704$0$9361$4d87748@xxxxxxxxxxxxxxxxxxxxxxxxxx
Mike Schilling wrote:
"Patricia Shanahan" <pats@xxxxxxx> wrote in message
news:13t06edrauqekc9@xxxxxxxxxxxxxxxxxxxxx
Andreas Leitgeb wrote:
Mike Schilling <mscottschilling@xxxxxxxxxxx> wrote:
...
In what ways are arrays not objects?
Don't know, if that's what Daniel meant, but arrays are not
accessed through get-/putfield (except for length) or invoke...
opcodes, but through <x>aload/<x>astore opcodes for <x> any
of [abcdfils].
That is an implementation detail in compilers that target bytecode, not
a Java language feature.

What Patricia said.

All of the array types (i.e. array of X) are subclasses [1] of Object; to
me, that says that arrays are objects.

1. Descendents, anyway. Do we know for a fact that their immediate
superclass is Object?
public class Foo {
public static void main(String[] args) {
System.out.println("Class: " + args.getClass());
System.out.println("Super: " + args.getClass().getSuperclass());
final List<? extends Class<?>> interfaces =
Arrays.asList(args.getClass().getInterfaces());
System.out.println("Interfaces: " + interfaces);
final List<Field> fields =
Arrays.asList(args.getClass().getFields());
System.out.println("Fields:" + fields);
final List<Field> declaredFields =
Arrays.asList(args.getClass().getDeclaredFields());
System.out.println("Declared Fields:" + declaredFields);

}
}


Class: class [Ljava.lang.String;
Super: class java.lang.Object
Interfaces: [interface java.lang.Cloneable, interface
java.io.Serializable]
Fields:[]
Declared Fields:[]

Yes, I know that the superclass is Object *now*, but I don't know whether
this is guaranteed.


.



Relevant Pages

  • Re: couple c and fortran 95
    ... I would always put middleware layer at either side of the interface not just ... Fortran by Reference. ... arrays or by passing a pointer from the C side of the interface. ... C strings are null terminated arrays of character; ...
    (comp.lang.fortran)
  • Re: INTERFACE problem
    ... Having an explicit interface makes *NO* difference at all. ... What matters is what the dummy arrays are like. ... If the dummy arrays look like f77 ones, then you will get f77-style passing no matter whether you have an explicit interface or not. ... meant to include passing an array element to an array dummy, and passing arrays with different rank than the dummy, both of which are somewhat unusual. ...
    (comp.lang.fortran)
  • Re: How to pass class as parameter?
    ... >> Brett wrote: ... >>> I have several classes that create arrays of data and have certain ... >>> MainClass makes use of third party objects to do this. ... across all the classes that will be implementing the interface. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: The current state of FORTRAN?
    ... code soon and I believe VB.NET arrays are virtually the same as VBA ... arrays so I could interface directly to the Fortran backend? ... VB.NET arrays are NOT virtually the same as VBA arrays. ... Ok Craig, thanks for the explanations - I won't try that then! ...
    (comp.lang.fortran)
  • Re: INTERFACE problem
    ... > without an INTERFACE Fortran 77 array passing rules still apply. ... Having an explicit interface makes *NO* difference at ... What matters is what the dummy arrays are like. ...
    (comp.lang.fortran)