Java error with a PrintWriter [duplicate]
问题 This question already has answers here : What is a NullPointerException, and how do I fix it? (12 answers) Closed 4 years ago . I have this code to connect a server with a client, i need send json objects to a android studio client but the method escribir in the line of the printwriter have a error, and i dont konw what is the problem, please see the code and help me public class Servidor { ServerSocket servidor=null; Socket socket=null; BufferedReader lector=null; PrintWriter escritor=null;