We will want to try out some code snippets in jshell as a means to explain Java programming to someone who is new to it. Moreover, some form of record of what code snippets were executed will be useful for the person who is learning the language.
In this recipe, we will execute a few code snippets and save them into a file. We will then load the code snippets from the saved file.