What difference does a Serialized object make as it can persist?

As we know, Serializable is a Marker interface (i.e. an interface without any methods).

So, I was wondering how to implement this interface so that the object of the implementation class is saved. Since besides the name Serializable, nothing exists for this interface.

And are there any other functions that we get by implementing this interface.

Is it possible to create a similar markup interface that does the same job with a different name? (This question is just a try.)

EDIT: May I extend the Serializable interface. and the advanced interface will also have the same property.

+3
source share
3 answers

, .

, ( , transient)

, , . , , , ..

", ", , , , ( , ?)

.

- , , .

, .

, ? ( - .)

, . , .

, , .

74: Serializable. Java-.

:

... , , . . , .

+4

Serializable, , . .

Java , Serializable . Java- IFoo, , , .

: .

+2

Using the interface Serializable, you tell the JVM that it can be saved. This has no other consequences. Btw is a marker interface , not a markup interface.

+1
source

Source: https://habr.com/ru/post/1732890/


All Articles