だから私はこのクラスのコンストラクターを持つ A を呼び出すとしましょう
A(String someA, int someB , String[] someC)
そして別のクラスで、これをクラス変数として持つメインを作成しました
private static String[] someC = new String[4];
private static ArrayList<A> thisA;
次に、dat ファイルからいくつかの情報を抽出します
someA= readFile.nextLine(); //some normal string such as bob Billy
someB= readFile.nextInt(); //some integer like 5
unitCode[0] = readFile.next(); //some code such as HITHERE34
unitCode[1] = readFile.next(); // all the 4 is the same style
unitCode[2] = readFile.next();
unitCode[3] = readFile.next();
thisA.add(new A(someA,someB,unitCode); // create object and store into array list
これを実行してみましたが、 unitCode を出力すると nullPointerException エラーが発生し、代わりにアドレスが返されました。どうすればこれを修正できますか?