Members of Java array class
<p>Reflexion API shows that any Java array class implements interface java.lang.Cloneable  and java.io.Serializable. It does not have any member declared. </p>

<p>My questions are:</p>

<ul>
<li><p>Where this 'length' is defined?</p></li>
<li><p>Where the  protected Object clone() is overridden with public access
specifier using co-variant return type(byte[] replacing Object) as we
can directly assign it to a byte[]?</p></li>
<li>Where the association(IS-A) with Cloneable and Serializable is
defined?</li>
</ul>

<p>Also access specifier for the byte[] class contains "abstract final" which is not a legal combination of any class or method in Java.</p>

<pre><code>    import java.lang.reflect.*;

    public class ArrayExplorer {

      public static void main(String[] args) {
      explore("Current class:", byte[].class);

      byte[] bytes = { 65, 'A' };
      System.out.println(bytes.length);

      byte[] cloned = bytes.clone();
      System.out.println(cloned);

   }

private static void explore(String msg, Class&lt;?&gt; class1) {
    if (class1 == null)
        return;

    System.out.println("**************************************\n" + msg
            + Modifier.toString(class1.getModifiers()) + " " + class1);

    // if (class1 == Object.class)
    // return;
    Field[] fields = class1.getDeclaredFields();
    for (Field field : fields) {
        System.out.println(field);
    }

    Method[] methods = class1.getDeclaredMethods();
    for (Method method : methods) {
        System.out.println(method);
    }

    explore("Superclass:", class1.getSuperclass());
    explore("Classes:", class1.getClasses());
    explore("ComponentType:", class1.getComponentType());
    explore("DeclaredClasses:", class1.getDeclaredClasses());
    explore("DeclaringClass:", class1.getDeclaringClass());
    explore("EnclosingClass:", class1.getEnclosingClass());

    if (!class1.isInterface()) {
        explore("Interfaces:", class1.getInterfaces());
    }

}

private static void explore(String msg, Class&lt;?&gt;[] classes) {
    if (classes == null || classes.length == 0)
        return;
    System.out.println(msg);
    for (Class&lt;?&gt; class1 : classes) {
        explore("", class1);
    }
    }
  }
</code></pre>
