File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How do u get the length of 2 dimensional array?

 
Ravi Sathish
Ranch Hand
Posts: 131
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi once again
How can I get the length of 2 dimensional array in a method?
to make myself clear:
main()
{
compute(emp);//method call
}
int[][] compute(int emp1[][])
{
int result =emp1[][].length;
// or how?
}
please help?
 
Michael Morris
Ranch Hand
Posts: 3451
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ravi,
Try running this and you should fully understand how it works:

Just try to think of a multidimensional array as being an array of arrays.
Hope this helps,
Michael Morris
[ February 07, 2003: Message edited by: Michael Morris ]
[ February 07, 2003: Message edited by: Michael Morris ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic