for (Iterator<Integer> iter = clients.keySet().iterator(); iter.hasNext(); )
{
int key = iter.next();
String addresses="ZeeshanNisar";
java.net.Socket client = clients.get(key);
System.out.print("ok3");
InetAddress zee = client.getInetAddress();
String s = zee.getHostName();
// String s=client.getInetAddress().toString();
System.out.print(s);
if (zee.getHostName()=="ZeeshanNisar")
{
System.out.print("ok4");
dos =new DataOutputStream(client.getOutputStream());
dos.writeUTF("Some message");
}
This piece of code is to send the message for a specific client connected to the Server let suppose the client name is zeeshannisar but in this my code isn't go to the if statement as there is no mistake as far as i think kindly help me.Sorry for my bad English.