2d String Array NullPointerException (java)

Posted by Student01 on Stack Overflow See other posts from Stack Overflow or by Student01
Published on 2009-11-23T21:26:24Z Indexed on 2010/04/23 16:43 UTC
Read the original article Hit count: 347

I am currently creating a java application in which I have a 2d array which I want to get some data into.

I am creating the 2d array as such

String[][] addressData;

and then when I am trying to put data in I am using reference the exact position in the 2d array I want to enter the data into e.g

addressData[0][0] = "String Data";

The program compiles yet when I run I get a NullPointerException error. Am I using the wrong method to enter data into this 2d array?

© Stack Overflow or respective owner

Related posts about java

Related posts about 2d-array