Join Todd Perkins for an in-depth discussion in this video Read data from a file, part of Learning Java Applications (2016).
- Now we'll review loading data from a text file.…You can create a text file by right-clicking your project,…and choosing New, Untitled Text File,…or choosing the same option…from the Toolbar, or the File menu.…When you create your text file,…add some text, as I have done here,…and Save the file to the root folder of your project.…So, let's Go To Review.Java, and…we're going to read the data using a BufferedReader.…So the first step is to create a FileReader.…I'll call this file, and set it equal to…a new instance of the FileReader class.…
This is going to reference our actual file.…So I'll pass in the String name to our file,…which is actually not "file," it's "hello."…So it's going to reference that file here.…When you see the error message,…you can always click on that,…and I'm suggested to Import FileReader,…which is in the Java.IO package, so,…I'm just going to double-click that there.…When we click the error message,…we'll actually get some information.…It's possible that the FileReader could fail,…if we're trying to Open a file that doesn't exist.…
- Installing Java and Eclipse
- Understanding basic Java syntax
- Handling Java errors
- Creating a UI with Swing
- Creating tables and connecting to data sources for tables
- Publishing a JAR file
- Installing NetBeans
- Creating JSP pages
- Setting up and connecting to databases
- Creating Java-based Android Studio projects
Skill Level Beginner
1. Install Java and an IDE
2. Java Basics Review
3. Create a User Interface with Swing
4. Tables and Data Sources
5. Application Distribution and Deployment
Publish a runnable JAR file2m 32s
6. Server-Side Java: JSP and Databases
7. Android Development
Next steps1m 16s
- 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.