And be careful about spelling; array and Array mean different things in Java. As Jesper says, you are using the array operators [] not a class called "array" (nor "Array"). Pushkar Choudhary, you are right to say
I'm not sure if this statement is correct.
Honey Rathore
Greenhorn
Joined: Nov 11, 2009
Posts: 7
posted
0
so array is only a kind of data structure
it is not a class
yes, there are some classes which contain methods for manipulating arrays. like class Arrays in java.util package
but there is an instance variable of name length of class name<idon'tknow> which tells you about the no. of elements in an array
then where is it come from?
is it from java.util.Arrays?
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35220
7
posted
0
but there is an static instance variable of name length of class name<idon'tknow> which tells you about the no. of elements in an array
then where is it come from?
is it from java.util.Arrays?
No, that's a convenience method provided by the compiler for arrays. It is not part of any class or interface.
but there is an static instance variable of name length of class name<idon'tknow> which tells you about the no. of elements in an array
then where is it come from?
is it from java.util.Arrays?
No, that's a convenience method provided by the compiler for arrays. It is not part of any class or interface.
Thanks....
|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
array is the only built in collection in Java. This built-in Java array is declared and constructed differently from most of the other java objects. It is a subclass of java.lang.Object, it implements both Serializable and Cloneable interfaces. We can't find a class definition for it in any of the Java Platform class. It's definition is built-in Java language!
Since array is inherited from java.lang.Object. Therefore, it understands all the methods of Object class. Besides the java.lang.Object methods, it also has its own accessible member variable length