wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Arrays Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Arrays" Watch "Arrays" New topic


Shiva Mohan
Ranch Hand

Joined: Jan 05, 2006
Posts: 477
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2367
Originally posted by Shiva Mohan:

Because in the first line, you are declaring an array of ints.

You cannot store null in that array.

In the second line you are declaring an array of arrays.

Since arrays are objects, references to arrays are object references.

So it is legitimate to store null in that array.

In the third line, ia1[0] is null, so you can't try to access its elements.
[ April 24, 2007: Message edited by: Keith Lynn ]
I agree. Here's the link: http://aspose.com/file-tools
subject: Arrays
Similar Threads
Array of zero length
problem with clone.......
Multi Dimensional Arrays
Why Extra Comma is allowed when constructing an array?