Skip to content

Commit cd75825

Browse files
author
bhuwang
committed
Rename the class name from Account to customized serialization.
1 parent 012263e commit cd75825

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

abc.ser

-4 Bytes
Binary file not shown.

src/com/bhuwan/java/serialization/Accounts.java src/com/bhuwan/java/serialization/CustomizedSerialization.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* @author bhuwan
1212
*
1313
*/
14-
public class Accounts implements Serializable {
14+
public class CustomizedSerialization implements Serializable {
1515

1616
/**
1717
*

src/com/bhuwan/java/serialization/SeriliazationDemo.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class SeriliazationDemo {
2121
* @throws ClassNotFoundException
2222
*/
2323
public static void main(String[] args) throws IOException, ClassNotFoundException {
24-
Accounts acc = new Accounts();
24+
CustomizedSerialization acc = new CustomizedSerialization();
2525
System.out.println("Before Serialization: user - " + acc.getUsername() + " pass - " + acc.getPassword());
2626

2727
// serialize
@@ -32,7 +32,7 @@ public static void main(String[] args) throws IOException, ClassNotFoundExceptio
3232
// de-serialize
3333
FileInputStream fis = new FileInputStream("abc.ser");
3434
ObjectInputStream ois = new ObjectInputStream(fis);
35-
Accounts account = (Accounts) ois.readObject();
35+
CustomizedSerialization account = (CustomizedSerialization) ois.readObject();
3636

3737
// print the value
3838
System.out.println("After Serialization: user - " + account.getUsername() + " pass - " + account.getPassword());

0 commit comments

Comments
 (0)