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

What is an http server?

550


Where is the network interface card located?

530


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

647


What are the advantages and disadvantages of java sockets.

616


Tell me about networking classes and interfaces.

634






Why socketutil is used?

616


Explain the generic term internet.

598


Explain look for local ports?

580


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

686


What is socket in java?

634


What is network programming in java?

575


What is cookies in networking ?

621


What is a listener in networking?

593


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.

676


What is a client tester?

586