From the course: Java 8 Essential Training

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Managing files with the original File class

Managing files with the original File class - Java Tutorial

From the course: Java 8 Essential Training

Start my 1-month free trial

Managing files with the original File class

- In this section of the course, I'm going to describe some practical tasks that most developers need to know how to do, including reading and writing files and communicating over the Internet. I'll start with file I/O. The Java class library in Java 8 implements two completely separate file I/O systems: the original system that was delivered with the original version of Java back in 1995, and has evolved somewhat since then; and a completely new version that was delivered with Java 7. In this demonstration, I'll talk about techniques that are available in all versions of Java, including Android's implementation because the newer libraries aren't available in all versions of Java, including Android's. I'm working in a project named CopyFile, and this project, in addition to the source files, has a files folder and there's a file there called loremipsum.txt. I'm going to demonstrate the Java code you'd need to make a copy of this file. Now you can use any file you want, including a…

Contents