This code compiles fine but when I try to create an object I get a NullPointer Exception for the indicated line. I don't see what the problem is, since c = 1 seems to make sense.
Joined: Dec 06, 2001
I assume you declared the array, otherwise you would have a compiler error. However, it looks like you didn't initialize the array using the "new" keyword. When you initialize the array depends on how you determine its size. Typically, you can initialize it when you declare it, like this:
If you need more help than this example gives, please post the declaration for this array.