Serialization and Vetor

Hi All,

As we aware that Vector and ArrayList are serialized, should my business objects, which are going to be placed in the ArrayList, which will be passed to EJB methods be serialized?

What my doubt is since the ArrayList is serailized, is it necessary that the business objects which the ArrayList holds should be serialized?

Thanx.
hemanexpAsked:
Who is Participating?
 
MeritorConnect With a Mentor Commented:
Yes, All your business objects must be serialized in an ArrayList.
0
 
MeritorCommented:
because while ArrayList is being serialized, all objects in arraylist are being serialized by JVM.
0
 
CEHJConnect With a Mentor Commented:
>>is it necessary that the business objects which the ArrayList holds should be serialized?

They will be serialized if they are Serializable and all the objects they contain are Serializable
0
 
Ajay-SinghConnect With a Mentor Commented:
All the elements of the ArrayList would be serialized. The serilization would throw error if one/more elements doesn't follow Serializable interface.
0
 
Mayank SConnect With a Mentor Associate Director - Product EngineeringCommented:
yes, it is nested. All data members of the business objects should also be serialized and so on & so forth.
0
All Courses

From novice to tech pro — start learning today.