It depends on you.... ( structuring patterns )

You can use FileWriter class for saving values in a file.

You can use Scanner class for reading back the generated text file.