 In the preceding video, I emphasize that you have to close files when you're done with them. Not only is it a good programming style, it's necessary for making sure that your output buffer gets written to disk. Still, it is sort of busy work. There's a way to avoid this busy work. Try with resources. Take the code that creates the scanner and printwriter, your resources, and enclose it in parentheses before the opening brace of the try block. Make sure you use parentheses or it won't work properly. Once you've done that, you no longer need to explicitly close the resources. As soon as the try catch block is done, Java will close them for you. Here's our code for switching the last and first names, and we're going to convert it to try with resources. We'll put our resources in parentheses and then the opening brace of our try block. And let's indent it properly as well. We can now get rid of our input.close and output.close, save, compile, and run. And there's our file with the names in last name first order. It still works. The book says that a try with resources doesn't need a catch clause. Let's put that to the test by commenting out our catch block here and recompile. This time we get an error. Why? Because opening resources from files can generate checked exceptions and those must be either caught or thrown. Since we haven't caught the exception, we have to say that our main method throws file not found exception. This is what the example in the book does. Now it compiles. But if I make the input file unavailable by changing people.text to nopeople.text and I run the program, the exception will get thrown to main which can't handle it and the Java virtual machine crashes our program. The moral of the story. Use try with resources to have Java automatically close files for you and use a catch block even if technically you don't need one.