i'm written a code that reads a line from the socket.
if the line is "bye" i want it to output "nice". from some reason it doesn't work, although i did try to output the input with no conditions and it did says "bye"
this is my code
String input = null; if (socket.getInputStream().available() > 0) input = in.readLine(); if (input != null) { input = input.trim(); if (input == "bye") out.println("nice"); out.println(input); }