Reading Java text files - Learning Java programming in German - 29

Опубликовано: 06 Июль 2026
на канале: Jonas Keil
26,278
590

Reading text files is something every good Java developer should know. That's why I'm going to show you how to read files in Java today.
... 0:00 Introduction
0:07 Saving a text file
0:26 Text as a File class
2:12 Short path name for the File class
3:18 Reading the text file (Scanner class)
4:53 Outputting the entire text
5:22 Explanation of Scanner methods
6:33 Reading complex text files
7:54 Reading and saving a dog
8:48 Information

📚You might also be interested in:

Writing to files:    • Dateien in Java ERSTELLEN | Java Programmi...  

Exceptions in Java:    • Exceptions in Java (try-catch-finally, thr...  

Object-oriented programming:    • Objektorientierte Programmierung (OOP) ERK...  

To read files in Java, you first need to create an object of the File class. To do this, you need to save either the entire path or just the name of your file, depending on whether you saved it in the project folder or not. You can then read this file line by line using the Scanner class.

🚀 Learn #Java in a playlist - https://bit.ly/3GKMucx

Reading text files might seem complicated at first... but I'm sure you'll understand it anyway! :) My respect to you if you follow along with the #tutorial and try the challenges! Then you'll really internalize the File and Scanner classes in Java!

Let me know in the comments if this video helped you learn how to read text files in Java!

👾 Code from the tutorials: https://github.com/Jonas-Keil/learn-java
============
🔔 Subscribe so you don't miss any more videos: https://www.youtube.com/c/JonasKeil?s...
============
📢 Link to the Discord community:   / discord  
============
🎉 If you like my videos, support me on Patreon:   / jonaskeil  

▬👇🏻Important Links👇🏻 ▬▬▬▬
1. Java IDEA 💻 from the videos: https://www.jetbrains.com/de-de/idea/...
2. Links to my equipment 🛠: https://kit.co/JonasKeil/studio-setup

3. Music 🎶 from all tutorials: https://www.epidemicsound.com/referra...

4. Java books 📚 that I can recommend: https://kit.co/JonasKeil/die-besten-j...

▬✨About this channel✨ ▬▬▬▬
Are you a student or pupil and want to learn the Java programming language, but don't know where to start? Then you've come to the right place!

On this channel, you'll find a guide that will help you learn Java step by step as a beginner. I know it's not always easy, and I'll do my best to explain everything as clearly as possible :) Have fun!!

Jonas Keil❤

#Programming #Java

PS: Some of the links in this description are affiliate links, from which I receive a commission :)