Review:
CSE148 Object Oriented Programming Homework Set 13
1. Java class design and implementation
2. Java interfaces: Comparable, Cloneable, Serializable
3. Binary IO: binary IO stream classes
Write a Java program to:
1.
2.
3)
Design a User class:
1) The class has fields of userID (unique, int), username (String), password (String), implement the following methods: constructor, copy constructor, getter/setter, and overriding toString();
2) Implement Comparable, Cloneable and Serializable interfaces; When implementing Comparable interface, select a criteria to make User objects comparable;
Design a Users class:
1) Users services as a container of all User objects;
2) Implement methods to add/remove/search/update user objects (s), overriding toString() to display information, equals() method to compare Users objects; Overriding clone() method to perform deep copy.
Write test program:
1) Create several User objects;
2) Create one Users instance;
3) Test methods to add/remove/search/remove user objects to/from Users container
4) Clone Users object to create another Users object (by calling clone() method);
5) Display all user objects in the Users instance;
6) Save Users object to a binary file;
7) Recreate Users instance from above binary file.
SCCC CSE148, Spring 2021