I am just trying to write someone's name and gender to a file, and then once the user closes and reopens the program, the program will still know the name and gender of said person, kind of like 'saving' user data.

I've been trying to figure out how to save data for a while and so far my only solution is just to write it to a file, and then have the program access that file.

I am able to get java to create and write a file, but I have no clue on how to return the users data.

Would this method even work? or is there and easier/better/different way of saving user data?

Any feedback or advice will be greatly appreciated! thanks!!:-)