This blog is about providing theory as well as simple executable codes of different programming languages such as java, C, C++, and web programming, etc. This blog will be helpful to the IT students to learn about programming.

Showing posts with label program using socket program to send the string "hello" to the client. Show all posts
Showing posts with label program using socket program to send the string "hello" to the client. Show all posts

Wednesday, March 8, 2023

What is the task of Socket class? Write program using socket program to send the string "hello" to the client.

March 08, 2023 0
 The Socket class in Java provides a way to create client-side sockets that can connect to a server on a given IP address and port number. Once the connection is established, the client and server can exchange data through the socket.Here's an example Java program that creates a server socket and sends the string "hello" to the client:import java.net.*;import java.io.*;public class Server {    public static void main(String[] args) {   ...

Slider Widget