The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes ObjectInput & ObjectOutput Streams Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "ObjectInput & ObjectOutput Streams" Watch "ObjectInput & ObjectOutput Streams" New topic
Author

ObjectInput & ObjectOutput Streams

Vikrama Sanjeeva
Ranch Hand

Joined: Sep 02, 2001
Posts: 756
In Asim Khan's note it is written that,

ObjectInptStream & ObjectOutputStream are processing streams, so it mutst be constructed on another stream(a data sink stream rather,like FileOutputStream)
.
My question is that both ObjectInput & ObjectOutput Streams have two constructor one of which does not take any arguments, i.e default constructor.So how we will construct ObjectInput & ObjectOutput Streams using this constructor.
Bye.
Viki.
------------------
Count the flowers of ur garden,NOT the leafs which falls away!


Count the flowers of your garden, NOT the leafs which falls away!
Prepare IBM Exam 340 by joining http://groups.yahoo.com/group/IBM340Exam/
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi Vikrama,
The only way you can use the protected constructor which accepts no parameters is to sublcass the ObjectInputStream or ObjectOutputStream. The no arg constructor is needed so that subclasses don't need to create any extra data just to get the functionality correct.
Just using the I/O methods in any java program will not allow you to call the no argument constructor.
Regards,
Manfred.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ObjectInput & ObjectOutput Streams