extends Serializable

When a class extends Serializable, the class becomes portable across different machines. As we show, .class has its own format and might not be compatible with normal byte representations. The goal of "extends Serializable" is to make the .class portable in byte format. That is to say, we can ship the bytes of the .class file and move it to another machine. And that machine can reconstruct the class from the byte files. Since bytes are portable between computers, so is the .class file. That's my girl!

猜你喜欢

转载自blog.csdn.net/qq_25527791/article/details/89328438