Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How will you override default serialization mechanism in java

Answers were Sorted based on User's Feedback



How will you override default serialization mechanism in java..

Answer / sharmila

Serializable is a marker interface. But you may wish to
control on how an object is serialized instead of using the
default mechanism. In such case add implementations of the
readObject() and/or writeObject() methods to the class being
serialized and override default serialization mechanism.

Also, instead of using Serializable interface,
Externalizable interface can be used

Is This Answer Correct ?    4 Yes 3 No

How will you override default serialization mechanism in java..

Answer / amit singh

you can inplements the Serialization interface for those
class you want to serailize
its marker interface its haven't any behaviour
but it indiacte that particular class is serializable
you can read and write particular object to convert in a
byte.
class Amit implements Serializable
{
Amit()
{
}
}
class B
{
public static void main(String []args)
{
Amit a = new Amit();
try{

}
catch{IoExcepton e)
{
}
try{
FileIntputStream f = new FileIntputStream("apoorva.txt")
OjectIntputStream o = new ObhjctInputStream(f);
o.ReadObject();
}
catch(IoException e)
{
}
}
thanks amit singh
amitsing2008@gmail.com

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More Core Java Interview Questions

Does variable declaration allocate memory?

0 Answers  


what is the need to set path in java? how many ways to set path in java? Explain breif?

5 Answers  


Is vector synchronized in java?

0 Answers  


What is the use of string and stringbuffer?

0 Answers  


Class A extends Class B but Class A also inherit Super Class Object so it is multiple inheritence give reason in support of your answer

3 Answers  


Interface A { String test(); } Interface B { int test(); } Create a class AB which must implements both A & B interfaces.

17 Answers   Hewitt,


What are the four versions of java?

0 Answers  


What is scope & storage allocation of global and extern variables? Explain with an example

0 Answers   IBS,


What are byte codes?

0 Answers  


What is parsing in grammar?

0 Answers  


What are peerless components in java programming?

0 Answers  


Is it compulsory to have atleast one abstract method in abstract class?

10 Answers  


Categories