Let's use JShell to learn about Paths and Files and Streams... here we go... this seems to work, since the Output window prints out the content of my file, which has two lines "hello" and "world":
Sweet documentation explains everything:
Next, let's put that useful code snippet to some use... i.e., we'll move it into a new Java source file in my application:
And there it is, all the verbosity/expressiveness of Java wrapped around our little snippet:
Hmmm. This will be pretty useful for anyone teaching and/or learning Java.