Serialization API and Flat File Database Project in Java

I am thinking this post will help to understand a lot of benefits of object-oriented programming of Java, Serialization API and flat file database in java. First of all, I shortly would like to mention how to be created and imported .jar file. This is called packages. Firstly, I created a new project called txtCreator.                                 

This class has two methods will provide to create and listing .txt file at data format which is desired. These methods have been listing or creating the data entered by user recording to file name which comes with a constructor of the class. Therefore, we’re fully complying with programming logic which is ‘art for folk’.

Then, I am clicking by coming to the Build and Clean option at the project.

the Output Screen

My .jar file was created in the dist folder on the project. Then, I am creating my main project called TutoressProject and I am adding to libraries the .jar file

TutoressProject –> Libraries –> left click Add JAR/Folder…

All in all, our pack class had been converted to FileCreator.class from FileCreator.java. Therefore, we can import to Tutoressproject the class by using the code of ‘ import txtcreator.FileCreator; ‘.

  • If user enter by instructor by selecting 1, will be listed 3 choice. These are List sentences, Create sentences and View student status.
  • If user enter by student by selecting 2, will be listed The elements of the sentence which are Verb, Noun, Adjective and Adverb.

If a student would like that be asked questions about verbs, the student enters ‘1’. Then, will be read from the .bin file student verb point which was written in the .bin file. and if the student answers the question correctly, the verb point will be raised 1, if the student couldn’t answer correctly, the verb point will be reduced 1. And then, the verb point will be written by bytecode to .bin file the Profil class which was serialized and kept the verb point.

If the program is entered as an instructor, the instructor can list of The elements of the sentence separately, can create a lot of questions and answers of the questions about the elements and can check up the student status.

I want to be listed randomly five answers and question which are pulled from data of a file which is named from the FileName variable which is assigned by the constructor method. On the other hand, I want to control the answers of the student. I would like that if a student enters wrong the answer, Point of the student will be decreased 1. But, if the answer is true, the Point of the student will be increased 1. In the above class, it’s done all about things.

In the above class, I have been controlling to be written to student.bin the variables of the Profil in which class is serialised.

Profil.java is a class is serialized taking implements Serializable.

If you think you have a problem with Serialization API, you can go to my post.
If you think you have a problem with Java Flat File Database, you can go to my post.

You can download the project on GitHub.

I transferred with a project all of my knowledge about Serialization API, Java Flat File Database. If you see my wrongs about the post, you can type to me. So, I can update the past. I hope that you have gotten benefits from the post. Thanks for reading…

20 Kez Okundu

Leave a Reply

Your email address will not be published. Required fields are marked *

Neon Light Text Effect