• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Basic Question

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
class arr{
public static void main(String s[]){

int[][] i=new int[2][4];
i[0]=new int[]{1,2,3,4,5,6,7};
System.out.println(i.length);
}
}

Hi,

In the abobe code, why it is not possible for me not to

call the length method like this i.length()..

Thanks In Advance.
 
Ranch Hand
Posts: 809
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
length() is not defined in arrays. There is no such method defined in array.

Arrays has a length field which is public and final

The Members of an Array Type

Naseem
[ August 06, 2006: Message edited by: Naseem Khan ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic