forked from txs72/JavaTutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestObjectInputStream.java
More file actions
executable file
·27 lines (25 loc) · 923 Bytes
/
TestObjectInputStream.java
File metadata and controls
executable file
·27 lines (25 loc) · 923 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* */ package ch17;
/* */
/* */ import java.io.FileInputStream;
/* */ import java.io.IOException;
/* */ import java.io.ObjectInputStream;
/* */ import java.util.Date;
/* */
/* */ public class TestObjectInputStream
/* */ {
/* */ public static void main(String[] args) throws ClassNotFoundException, IOException {
/* 11 */ try (ObjectInputStream input = new ObjectInputStream(new FileInputStream("object.dat"))) {
/* */
/* */
/* */
/* 15 */ String name = input.readUTF();
/* 16 */ double score = input.readDouble();
/* 17 */ Date date = (Date)input.readObject();
/* 18 */ System.out.println(name + " " + score + " " + date);
/* */ }
/* */ }
/* */ }
/* Location: /Volumes/TXS.128G/hope useful/practice/2020.jar!/ch17/TestObjectInputStream.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.1.3
*/