Win a copy of Create an Uber Clone in 7 Days: Build a real world full stack mobile app in Java this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Arrays  RSS feed

 
Ranch Hand
Posts: 486
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Ranch Hand
Posts: 2410
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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 RELEASE YOU! (for now .... ) Feel free to peruse this tiny ad:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!