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 a daytime server?

829


What is a listener in networking?

807


Explain look for local ports?

832


What is HttpURL connection ?

824


What is the use of network interface?

684


What are the advantages and disadvantages of sockets?

776


Explain the generic term internet.

795


Tell me about networking classes and interfaces.

816


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.

863


What is a thread pool?

833


What is a client tester?

754


What you know about random port?

759


What is cookies in networking ?

810


Where is the network interface card located?

720


Explain a time server?

788