Java classes that implement the Serializable interface?

In the Java API, most of the classes implement Serializable ( here is a full list). Classes that need to be serialized implement Serializable. You can use an IDE to find all implementors of an interface in your project.

In the Java API, most of the classes implement Serializable (here is a full list). Classes that need to be serialized implement Serializable. You can use an IDE to find all implementors of an interface in your project.

1 for posting the class-use before I could. – Michael Myers? Jun 3 '09 at 16:31.

You can find a full list of all implementing classes Here. If you need to check programatically, you can use the instanceof operator to check to see if an object is an instance of the Serializable interface. The list of subinterfaces is not a list of all classes that actually implement the interface.

If you use Eclipse, then in any place you see "Serializable" (such as in the class definition below): import java.io. Serializable; public Foo implements Serializable { } Click on Serializable so that the text marker is in the word t Control + T It should take a minute because this is such a prevalent interface, but it will display all the classes it can find on your classpath which implement Serializable.

It gives a full list of all the classes on your classpath that implement Serializable, and this is a much more comprehensive list than the ones given above. – Cuga Jun 3 '09 at 16:35 I guess you got the downvotes because you suggested making a class just for the sake of being able to select the Serializable interface. I would suggest accessing the interface by hitting Ctrl + Shift + T, and typing Serializable into the filter box.

After that, you can either hit the above mentioned Ctrl + T to get the class hierarchy in a floating widget, or F4 to get it in a separate view. – Zsolt Török Jun 3 '09 at 16:41 I see what you mean. I didn't intend to imply this was the only way to open the type hierarchy-- I wanted it to be easy and clear to see how it can done.

– Cuga Jun 3 '09 at 16:47 The original question was for "a list of classes that implement Serializable". What list? Serializables in the JDK?

Serializables in a large mess of code you've just inherited? Either interpretation is reasonable, and learning how to look up the information in both situations is helpful. – Jim Ferrans Jun 3 '09 at 18:16.

Implementing Serializable effectively makes classes and subclasses part of the public API. You can see at least some of the serialisable classes by clicking on the Serial Form link in Javadoc output. Some of these classes are not public/protected as such (in the API docs they won't have links to the class documentation).

Serialisable anonymous inner classes don't appear to appear, although there are a few this$0 fields.

The quick answer is: Any class that you want to store for later use. This includes things like the data wrappers (Integer, String, Character, etc...), data classes, and Collections. However, Collections are only serializable if the items in them are serializable.

Also, there is a second interface, Externalizable, that is used by classes that write their data to some sort of external interface, with only a reference to said item stored in the serialization stream.

Serialization is not for long-term storage. Only for short-term uses such as communication. Classes that implement Externalizable do store their externalised state in the serialization stream.

The difference between serialisabke and exrernalisable classes is that the serialiser is responsible for the stream format of serialisable classes but externalisable classes implement their own format. – Nat Jun 3 '09 at 18:53 Sorry for the typos: I wrote it on an iPhone. – Nat Jun 3 '09 at 18:54.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions