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

Can substring create new object?

1072


Explain the difference between arraylist and linkedlist in java?

940


What is the effect of keeping a constructor private?

891


Is hashmap thread safe?

947


What is math in java?

1031


how to create multithreaded program? Explain different ways of using thread? When a thread is created and started, what is its initial state? : Java thread

972


Mention some interfaces implemented by linked list in java.

986


What is finally and finalize in java?

1032


What is instance synchronization?

1015


Does every java program need a main?

955


What is class and its types?

983


What is return type in java?

1020


Does java linked list allow duplicates?

925


Is stringwriter thread safe?

949


Why lambda expression is used in java?

1010