GeeCON Prague 2014*
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


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.
 
GeeCON Prague 2014
 
subject: Array.length