This repository was archived by the owner on Feb 16, 2022. It is now read-only.
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMethodsTrash.java
More file actions
Latest commit
42 lines (29 loc) · 1.22 KB
/
Copy pathMethodsTrash.java
File metadata and controls
42 lines (29 loc) · 1.22 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
publicclassMethodsTrash {
/*
try {
ObjectInputStream objReader = new ObjectInputStream(new FileInputStream("departments.dat"));
dpt = (LinkedList<Department>) objReader.readObject();
System.out.println(dpt);
} catch (FileNotFoundException createFile) {
System.out.println("File was not found, creating file with default values");
} catch (IOException e) {
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
ObjectOutputStream objReader = new ObjectOutputStream(new FileOutputStream("departments.dat"));
dpt = new LinkedList<Department>();
dpt.add(new Department("COE", "Computer Engineering", new LinkedList<Student>()));
dpt.add(new Department("SWE", "Software Engineering", new LinkedList<Student>()));
dpt.add(new Department("ME", "Mechanical Engineering", new LinkedList<Student>()));
dpt.add(new Department("EE", "Electrical Engineering", new LinkedList<Student>()));
System.out.println(dpt);
objReader.writeObject(dpt);
objReader.close();
} catch (FileNotFoundException createFile) {
System.out.println("File was not found, creating file with default values");
} catch (IOException e) {
}
*/
}