📄 serializedate.java
字号:
import java.util.*;
import java.io.*;
public class SerializeDate {
Date d ;
SerializeDate( ){
d= new Date( );
try {
FileOutputStream f = new FileOutputStream("date.ser");
ObjectOutputStream s= new ObjectOutputStream(f);
s.writeObject(d);
f.close( );
}catch( IOException e){
e.printStackTrace( );
}
}
public static void main(String args[]){
SerializeDate b =new SerializeDate();
System.out.println("The saved date is :"+b.d.toString());
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -