Question: Need help running this Java program with a screenshot and brief detail of what the program does. import java.io.*; import java.net.*; import java.util.*; public class

Need help running this Java program with a screenshot and brief detail of what the program does.

import java.io.*;

import java.net.*;

import java.util.*;

public class BufferedServer

{

public static void main (String[] args)

{

try {

int portNumber = 0; // let the system find an available port

to use.

ServerSocket ss = new ServerSocket(portNumber);

System.out.println("Server listening at " +

InetAddress.getLocalHost() +

" on port " + ss.getLocalPort());

while (true)

{

Socket s = ss.accept(); // wait here for a

client to call

InputStreamReader isr = new

InputStreamReader(s.getInputStream());

BufferedReader br = new BufferedReader(isr);

String msg = br.readLine();

System.out.println(msg);

}

}

catch(Exception e)

{

System.out.println(e);

}

}

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!