Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
    Bookmark Topic Watch Topic
  • New Topic

Find the error in this program!!!

 
shribalaji arumugham
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Report post to moderator


[edit]Add code tags. CR[/edit]
[ July 21, 2008: Message edited by: Campbell Ritchie ]
 
Mark Vedder
Ranch Hand
Posts: 624
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Report post to moderator
Here's a hint... where is the code putting anything into the array? The code creates an array, then tries to get things out of it and then act on those things (i.e. call its get() method).

Only arrays of primitives (i.e. ints, bytes, floats, etc) are initialized with default values. Arrays of objects are defaulted to null values.
[ July 21, 2008: Message edited by: Mark Vedder ]
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
I already explained this to you here.
 
Campbell Ritchie
Sheriff
Posts: 48910
58
  • Mark post as helpful
  • send pies
  • Report post to moderator
Originally posted by Ernest Friedman-Hill:
I already explained this to you here.
In which case I shall have to regard this thread as a duplicate. Please read this. I think I shall have to close this thread.
 
    Bookmark Topic Watch Topic
  • New Topic