Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
Question about Java programming: How do I implement the 'Serializable' interface?
The assignment said for me to implement the interface into a couple of pre-existing classes we had done beforehand but when I change my class header to implement the interface, it compiles without a problem even though I did not implement any method headings.
Does this mean that the interface doesn't have any methods to define?
If so, how does this interface work if it doesn't have any possible methods?
1 Answer
- husoskiLv 74 years ago
There are no format methods to implement. Most classes can use the default serialization supplied by Java. If there are special requirements, such as fields that are not Serializable, then you can take control by writing your own implementations of readObject(), writeObject and readObjectNoData(). The process is documented in the Java Object Serialization Specification:
https://docs.oracle.com/javase/8/docs/platform/ser...
Oh yes, be sure to read the Serializable docs: