Is it possible to send an object using Sockets, if so, how
it can be?

Answer Posted / afzi

Yes it is Poosible to send an Object using Sockets,

for example refer to below given code snippet.

ObjectOutputStream out = new ObjectOutputStream
(socket.getOutputStream());
out.flush();
ObjectInputStream in = new ObjectInputStream
(socket.getInputStream());
type=(String)in.readObject();
out.writeObject("ok");
in.close();
out.close();
socket.close();

Is This Answer Correct ?    6 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the generic term internet.

595


What is a listener in networking?

588


What is network interface name?

545


What is the main difference between Client side Java Script and and Server side Java Script how actually they run on both side with Example.

669


Public serversocket(int port, int queuelength) throws ioexception, bindexception?

679






What is the use of network interface?

502


What is HttpURL connection ?

628


If you do not want your program to halt while it waits for a connection, put the call to accept( ) in a separate thread?

551


What do you understand by the term network?

571


Explain a daytime server?

644


How we can make simple java program for Server/Client Communication

641


What is jhttp web server?

765


What is socket in java?

631


What is an http server?

544


What is the Difference between socket and servlet?

792