File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Array.length Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Array.length" Watch "Array.length" New topic
Author

Array.length

Weerawit Maneepongsawat
Ranch Hand

Joined: Apr 11, 2002
Posts: 203

why it throw ArrayIndexOutOfBoundsException
??? i think arr[1][2].length = 0 ??


Weerawit<br />SCJP 1.4, SCWCD 1.2, SCWCD 1.4, SCBCD 1.3, SCBCD 5.0, SCMAD 1.0, SCJA 1.0, SCDJWS, SCJD, SCEA, SCDJWS 1.5
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
No. a[1] is { { "1", "2" }, { "1", null, "3" } }
a[1][0] is { "1", "2" }, and a[1][1] is { "1", null, "3" }, and a[1][2] is ???


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Array.length
 
Similar Threads
Three dim array
Two and Three dimensional array
Arrays
Array Problem
jq+ code