I have written a simple java code to send a message from server to client and the client should display it respectively. The codes are.
Client.java
impor
Referring all your answers and searching a bit on google i have finally got the code running by making the following changes in Server Class.
while (true) {
Socket mysocket = server_socket.accept();
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(mysocket.getOutputStream()));
BufferedReader reader = new BufferedReader(new InputStreamReader(mysocket.getInputStream()));
writer.write("Hello omkar \n");
writer.flush();
System.out.println("data sent");
}