The application should use a text file to capture the whole vehicle accidents data structure. To do this, add two methods to your center class:
1. A method to save the content of the created Java structure into a text file.
2. A method to restore the saved content back into an appropriate Java data structure for next run time.
Java provides a facility to create your own Exceptions which are basically derived classes of Exception. Write a class that defines a duplicate exception. The duplicate exception will be thrown if accidents are duplicated in the accidents list.
Design and implement a separate testing class to test the designed classes and check if classes meet the requirements.
Comments
Leave a comment