I'm trying to use an array in my program but it always gives me NullPointerException. It think the exception refers that the array has only null values when I'm trying to give them a value. Take a closer look at the code:
And so on.
The exact message I get looks like this:
Exception in thread "main" java.lang.NullPointerException
What's going wrong. I had the same problem with another program too, but I solved it by creating a constant sized array (in other words the array size was defined by a constant, not variable).