How to Write to a File in Java

So far, we were seeking outputs in the console area. But we can get it in a file as well. Yes, we are going to learn how to write to a file in Java...