Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Serialization and Vetor

Posted on 2006-07-17
7
Medium Priority
?
218 Views
Last Modified: 2010-03-31
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.
0
Comment
Question by:hemanexp
5 Comments
 
LVL 4

Accepted Solution

by:
Meritor earned 256 total points
ID: 17122470
Yes, All your business objects must be serialized in an ArrayList.
0
 
LVL 4

Expert Comment

by:Meritor
ID: 17122502
because while ArrayList is being serialized, all objects in arraylist are being serialized by JVM.
0
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 248 total points
ID: 17122671
>>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
 
LVL 23

Assisted Solution

by:Ajay-Singh
Ajay-Singh earned 248 total points
ID: 17123156
All the elements of the ArrayList would be serialized. The serilization would throw error if one/more elements doesn't follow Serializable interface.
0
 
LVL 30

Assisted Solution

by:Mayank S
Mayank S earned 248 total points
ID: 17129845
yes, it is nested. All data members of the business objects should also be serialized and so on & so forth.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question