In a previous video, you learn about how to copy files using the classes that were part of Java from the beginning. But in Java 7, a new set of classes and interfaces were created that do the work much more easily. This coding style is also supported in Android starting with Android 8, Oreo—but like some other new language features, it won’t work on older devices.
- I previously described how to copy files…using the classes that were part of Java from the beginning.…But in Java 7, a new set of classes and interfaces…were created that do the work much more easily.…This coding style is also supported in Android,…starting with Android 8 Oreo,…but like some other new language features,…it won't work on older devices.…I'll start by creating an instance of a class called Path.…A path in Java represents either a file or a directory.…
I'll name this sourcefile,…and I'll initialize it with Paths.get.…This method receives a series of strings.…The first string is the directory.…Subsequent strings can either be the directory,…or if it's the last string, it'll be the name of the file.…So my file is stored in the files directory.…I'll enter that as the first value,…and then I'll enter the name of the file, Loremipsum.txt,…and if you had sub-directories after files,…you would place those directory names…between the files directory and the file name.…
I'll duplicate that line,…and this one will be the target file,…
- Debugging Java code
- Handling exceptions
- Creating custom classes
- Working with inheritance
- Managing data collections
- Using Java packages and libraries
- Preparing a Java application for deployment
Skill Level Intermediate
1. Exception Handling and Debugging
2. Create Custom Classes
3. Work with Inheritance
4. Manage Data Collections
5. Use Java Packages and Libraries
Work with dates and times7m 12s
6. Prepare a Java Application for Deployment
Next steps1m 12s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.