📄 testcustom.java
字号:
import java.io.*;
class testCustom
{
public static void main( String args[] ) throws Exception
{
serialize();
deserialize();
}
public static void serialize() throws Exception
{
OutputStream outputFile = new FileOutputStream( "SerializedCustom" );
ObjectOutputStream cout = new ObjectOutputStream( outputFile );
cout.writeObject( new custom2( 12));
cout.close();
}
public static void deserialize() throws Exception
{
InputStream inputFile = new FileInputStream( "SerializedCustom" );
ObjectInputStream cin = new ObjectInputStream( inputFile );
custom2 test = (custom2) cin.readObject();
System.out.println( test.toString() );
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -