The code to do create an instance of class SelectedTag is as follow:
The error is in line 4 which results in java.lang.NullPointerException.Code :Tag[] array; array = new Tag[4]; array[1] = new Tag(); SelectedTag d = new SelectedTag(2,array);
Printable View
The code to do create an instance of class SelectedTag is as follow:
The error is in line 4 which results in java.lang.NullPointerException.Code :Tag[] array; array = new Tag[4]; array[1] = new Tag(); SelectedTag d = new SelectedTag(2,array);
Perhaps the exception is occurring within the SelectedTag constructor.
That's only a guess. Consider posting some code that compiles but throws that exception when it is run. Make the code as simple and short as possible to illustrate the problem.