I started reading about serialization in Java and a few other languages, but what if I have a generic class and I want to save its instance to a file.
code example
public class Generic<T> { private T key; public Generic<T>() { key = null; } public Generic<T>(T key) { this.key = key; } }
What is the best way to save this kind of object? (Of course, in my real class, but I'm just interested in the real idea.)
java generics serialization
Leolian
source share