NullPointerException in PrintWriter[] array - Java
问题 I have a problem which i am trying to figure out for days now. Simple Code Overview(PseudoCode): 1 - When a user connects create a PrintWriter for him. 2 - Store the PrintWriter object into a PrintWriter[] array. 3 - Increment the number of users connected. What is my problem? The compiler throws a NullPointerException What caused the NPE? When the sendMessage() method is called by object created in the mainWindow class the PrintWriter array if empty, i don't know what is causing it to be