The best and cleanest way to do this is to use the java class java.io.FileWriter and PrintWriter, to write and store your variables to a text file.
Getting Started
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: