Here is the java package-tree: http://docs.oracle.com/javase/7/docs/api/java/lang/package-tree.html
I read a tutorial on Java which stated that in Java arrays are objects.
Where is the array class? How comes we can make arrays like this:
byte[] byteArr = new byte[];
char[] charArr = new char[];
int[] intArr = new int[];
and the arrays will inherit methods from Object; for example:
byte thisByte = 1;
byte thatByte = 2;
byte[] theseBytes = new byte[] {thisByte, thatByte};
int inheritance = theseBytes.length; //inherited 'length' field and some methods
int wasntInWill = thatByte.length; //error
What's going on here?
EDIT:
As per the answers, I now know it is a final
class in java.lang.reflect
package.
I have now created a package java.lang.reflect
in my Android project and have added a class called Array.java to it. To confirm this is in the way of the original class, Eclipse gave me the error "... already exists in path/to/android.jar"
If I write out the same class as java.lang.reflect.Array
but change the toString()
method... this should work within my application right?