Java Socket Programming Interview Questions and Answers - 1

Question: 1

What is the proxy server?

A proxy server speaks the client side of a protocol to another server.

This is often required when clients have certain restrictions on which servers they can connect to.

And when several users are hitting a popular website, a proxy server can get the contents of the web server’s popular pages once, saving expensive internetwork transfers while providing faster access to those pages to the clients.

Question: 2

What are the disadvantages of Java Sockets?

Socket based communication allows only to send packets of raw data between applications.

Both the client side and server side have to provide mechanisms to make the data useful in any way.

Question: 3

What are the advantages of Java Sockets?

Sockets are flexible and sufficient. Efficient socket based programming can be easily implemented for general communications.

It cause low network traffic.

Question: 4

Define network programming?

It refers to writing programs that executes across multiple devices (computers), in which the devices are all connected to each other using a network.

Question: 5

Which class represents the sockets that both the client and server use to communicate with each other?

java.net.socket 

Related Questions