Questions tagged [serializable]

Serialization is the process of converting a data structure or object state into a format that can be stored. The `SerializableAttribute` is a .NET Framework attribute that signifies the object is serializable. The `Serializable` Java marker interface indicates that an object can be serialized using standard JVM serialization mechanisms. Other languages and frameworks have similar abstract classes or attributes.

Serialization is the process of converting a data structure or object state into a format that can be stored.

The SerializableAttribute is a .NET Framework attribute that signifies the object is serializable. Other languages and frameworks have similar abstract classes or attributes.

The Serializable Java marker interface indicates that an object can be serialized using standard JVM serialization mechanisms.

Other uses of this tag should probably use .

854 questions
1973
votes
22 answers

What is a JavaBean exactly?

I understood, I think, that a "Bean" is a Java class with properties and getters/setters. As much as I understand, it is the equivalent of a C struct. Is that true? Also, is there a real syntactic difference between a bean and a regular class? Is…
Amir Rachum
  • 67,681
  • 68
  • 159
  • 239
349
votes
15 answers

Android: Difference between Parcelable and Serializable?

Why does Android provide 2 interfaces for serializing objects? Do Serializable objects interopt with Android Binder and AIDL files?
live2dream95
  • 5,079
  • 8
  • 24
  • 24
290
votes
11 answers

What is the difference between Serializable and Externalizable in Java?

What is the difference between Serializable and Externalizable in Java?
Sasha
237
votes
5 answers

What does it mean: The serializable class does not declare a static final serialVersionUID field?

I have the warning message given in the title. I would like to understand and remove it. I found already some answers on this question but I do not understand these answers because of an overload with technical terms. Is it possible to explain this…
Roman
  • 97,757
  • 149
  • 317
  • 426
142
votes
11 answers

What does Serializable mean?

What exactly does it mean for a class to be Serializable in Java? Or in general, for that matter...
Ritwik Bose
  • 5,199
  • 7
  • 30
  • 42
79
votes
7 answers

Android ArrayList of custom objects - Save to SharedPreferences - Serializable?

I have an ArrayList of an object. The object contains the types 'Bitmap' and 'String' and then just getters and setters for both. First of all is Bitmap serializable? How would I go about serializing this to store it in SharedPreferences? I have…
Paul Blundell
  • 1,762
  • 4
  • 21
  • 25
78
votes
5 answers

Why does HttpServlet implement Serializable?

In my understanding of Servlet, the Servlet will be instantiated by the Container, its init() method will be called once, and the servlet will live like a singleton until the JVM shuts down. I do not expect my servlet to be serialized, since it will…
Andreas Petersson
  • 15,672
  • 11
  • 56
  • 91
75
votes
4 answers

Serializing private member data

I'm trying to serialize an object to XML that has a number of properties, some of which are readonly. public Guid Id { get; private set; } I have marked the class [Serializable] and I have implemented the ISerializable interface. Below is the code…
Jon Mitchell
  • 3,109
  • 5
  • 24
  • 35
55
votes
4 answers

What is the point of the ISerializable interface?

It seems like I can serialize classes that don't have that interface, so I am unclear on its purpose.
leora
  • 163,579
  • 332
  • 834
  • 1,328
54
votes
4 answers

Is using Serializable in Android bad?

I've been reading a lot of posts and articles extolling the speed of Parcelable over Serializable. I've been using both for a while to pass data between Activities through Intents, and have yet to notice any speed difference when switching between…
Alpha Hydrae
  • 2,731
  • 5
  • 23
  • 23
54
votes
4 answers

How to pass ArrayList from one activity to another?

I want to send Following ArrayList from one activity to another please help. ContactBean m_objUserDetails = new ContactBean(); ArrayList ContactLis = new ArrayList(); I am sending the above arraylist after adding data in…
DCoder
  • 3,304
  • 7
  • 32
  • 64
53
votes
5 answers

Do Hibernate table classes need to be Serializable?

I have inherited a Websphere Portal project that uses Hibernate 3.0 to connect to a SQL Server database. There are about 130 Hibernate table classes in this project. They all implement Serializable. None of them declare a serialVersionUID field, so…
Scott Leis
  • 2,468
  • 5
  • 25
  • 40
48
votes
1 answer

using XmlArrayItem attribute without XmlArray on Serializable C# class

I want XML in the following format: ... ...
Sarah Vessels
  • 27,994
  • 29
  • 147
  • 217
46
votes
4 answers

Why should I always make my Exceptions [serializable]? (.NET)

Referring to What is the correct way to make a custom .NET Exception serializable? and Are all .NET Exceptions serializable? ... Why should my exceptions be serializable? Someone said "it can be considered a bug" if a custom exception defined by a…
Cheeso
  • 180,104
  • 92
  • 446
  • 681
43
votes
4 answers

How can I add a type constraint to include anything serializable in a generic method?

My generic method needs to serialize the object passed to it, however just insisting that it implements ISerializable doesn't seem to work. For example, I have a struct returned from a web service (marked with SerializableAttribute) that serializes…
Matt Brindley
  • 9,353
  • 6
  • 43
  • 48
1
2 3
56 57