📄 serialreadtest.java
字号:
/**
* @(#)SerialReadTest.java
*
*
* @author
* @version 1.00 2007/11/17
*/
import java.io.*;
import java.util.*;
public class SerialReadTest {
/**
* Creates a new instance of <code>SerialReadTest</code>.
*/
public SerialReadTest() {
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
try {
ObjectInputStream in=new ObjectInputStream(new FileInputStream("4.txt"));
int i=in.readInt();
Date date=(Date) in.readObject();
Address address=(Address) in.readObject();
in.close();
System.out.println("Integer:"+i);
System.out.println("Date:"+date);
System.out.println("Address:"+address);
}
catch (ClassNotFoundException cnfe) {
System.out.println(cnfe);
}
catch (IOException ioe) {
System.out.println(ioe);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -