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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

which one is more efficient int x; 1. if(x==null) 2.if(null==x) state which one either 1 or 2?

11045


What's the difference between int and integer in java?

1115


What is json parser in java?

1027


Explain about main() method in java ?

1020


What is isa relationship?

994


Why to use nested classes in java?

1069


According to java operator precedence, which operator is considered to be with highest precedence?

1055


Which way a developer should use for creating thread, i.e. Sub classing thread or implementing runnable.

898


What is the longest unicode character?

1117


How do you sort data in java?

914


What is a function easy definition?

974


What is the difference between equals() and?

1144


What is the purpose of the strictfp keyword?

1127


Why array is used in java?

937


Why are arrays useful in java?

994