WRITE A JAVA PROGRAM THAT IMPLEMENTS A SIMPLE
CLIENT/SERVER APPLICATION.
import [Link].*;
import [Link].*;
class Client
{
public static void main(String ar[])throws Exception
{
Socket s=new Socket([Link](),10000);
[Link]("enter the radius of the circle ");
DataInputStream dis=new DataInputStream([Link]);
int n=[Link]([Link]());
PrintStream ps=new PrintStream([Link]());
[Link](n);
DataInputStream dis1=new DataInputStream([Link]());
[Link]("area of the circle from server:"+[Link]());
}
}
import [Link].*;
import [Link].*;
class Server
{
public static void main(String ar[])throws Exception
{
ServerSocket ss=new ServerSocket(10000);
Socket s=[Link]();
DataInputStream dis=new DataInputStream([Link]());
int n=[Link]([Link]());
PrintStream ps=new PrintStream([Link]());
[Link](3.14*n*n);
}
}
OUTPUT
enter the radius of circle : 3
area of the circle from the server: 28.86