What code should I use to make save and load commands? It's for storing variables that can be re-loaded by the user after shutting the program down.

Let's say I have integer "apple", boolean "orange" and string "banana" variables. What's the code I would need?