class testArrayLength { private static int [] arr = new int[10]; public static void main(String ar[]) { System.out.println(arr.length); } }
the output is 10...
please someone help me from where this variable length came from the API... how is the arr.length works..??? and that too it is length and not LENGTH... all are of lower case.. please help.. thanks in advance...
Arrays are objects, but there is no class definition associated with it. They inherit some methods from Object and when created the length field is initialized.
length is benificial var that will return u the length of array .getting !! so explore ur skills of using it. instead of unnessesarily findng its history.
'MAN IS CREATURE WHO TAKES MORE INTREST IN TEACHING INSTEAD OF LEARNING NEW THINGS'
These are the worst of times and these are the best of times. And this is the best tiny ad:
Gift giving made easy with the permaculture playing cards