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...

I have 2 objects inside one object(vector). how can i
serialize one of them. I dont want to serialize the second one

Answer Posted / atre sachin

suppose we are storing the two object of class A in Vector v1

class A implements serialiazable{
....
}

A a1=new A() //this will be the persist
transient A a2 =new A() //this will not persist because of the transient keyword.

now if I store the both a1 and a2 object in the vector v1 then we can achieve the goal given.
:-)

Is This Answer Correct ?    10 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a top level class in java?

1086


Why packages are used?

1687


What is comparable and comparator interface? List their differences

1150


How does arraylist work in java?

1168


What is jvm? Why is java called the platform independent programming language?

1078


What is ordered map in java?

1061


What does the string method compareto () do?

1113


Why call by value prevents parameter value change?

1125


Can a set contain duplicates?

1002


What is default constructors?

1074


What is the difference between double and float variables in java?

1200


How do you declare a variable?

1140


Can we overload final method in java?

1033


make a method which any number and any type of argument and print sum of that arguments.....

1861


What is abstract class constructor called?

1077