 Until now, we've done all our input from the keyboard and all of our output to the screen. This input and output has a lifespan of the program. We'd like to be able to read our input from files and write output to files so our data takes a more permanent form. The Java file object gives you access to information about the file. If you want the contents, there are other classes that you use to do that. To access that information about a file, create a new file object with the file name, or path name. There are two kinds of path names, absolute and relative. An absolute path name on Windows includes the drive name and is often written with backslashes. When you open a file using backslashes, you must use two backslashes in a row because backslash is the escape character for strings. You can use a forward slash as your directory separator if you prefer. Java will automatically fix it to do the right thing on Windows. However, it's better not to use absolute path names. If someone on Macintosh or Linux wants to use your program, it will fail because neither of those operating systems has a letter named hard disk drives. Instead, use relative path names that describe where a file is in relation to the directory where you have your Java source and class files. In this example, the states.csv file is in the same directory as the class file. So all we need to specify is the file name. The relative path to the names.txt file is a bit more complicated. See the link in the video description for a lengthier discussion of relative path names. Once you've created a file, what kind of information can you get about it? Here's a program that prompts the user for a file name and then opens a file with that file or path name. It then tells you if the file exists or not. This is the best way to find out if the user has entered a valid file name. You can find out if the file is a directory or a plain file. File.length gives you the size of the file in bytes. You can find out if you have permission to read the file or write information to the file. Did you use an absolute path name when creating this file? Is it a hidden file? When was it last modified? And what is its true absolute path name? Although you should avoid absolute paths, there will come a time when you need one so you need to know how to get it. The file class also has methods to create directories, delete files, and rename files, but we won't go into those here. Let's run the program and try it on a few files. First, let's try something called nosuchfile.txt. It doesn't exist, so we're going to get a lot of false and zero bytes. You'll notice on my full path name that I don't have a C drive. That's because I'm running on Linux instead of Windows. Let's try a file that does exist. States2019.csv. It exists. It's not a directory. It's a plain file. 923 bytes long. I can read it and write it. I didn't use an absolute path. It's not hidden. Here's when I last modified it. And here's its full path name. Now that you have a file object and you know how to access the information about it, you can use that file object to read and write the file that it represents. And that's the subject of the next videos.