If I make a class with only methods and no variables, with each method having its own local variable then, will that class be thread-safe? for eg.
public class Client {
public String xyz(final String inputXML) {
DataInputStream dis = null;
DataOutputStream dout = null;
Socket clientSocket = null;
//do some processing
}
public String abc(final String inputXML) {
DataInputStream dis = null;
DataOutputStream dout = null;
Socket clientSocket = null;
//do some processing
}
}
now if I launch multiple threads of this Client then, will the class be thread safe ?