⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testcustom.java

📁 java应用开发详解
💻 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 + -