Learn Java Tutorial for Beginners, Part 33: Reading Text Files

///Learn Java Tutorial for Beginners, Part 33: Reading Text Files

Learn Java Tutorial for Beginners, Part 33: Reading Text Files

FavoriteLoadingAdd to favorites

Get complete courses at
This is a video on the simplest way to read a text file line-by-line in Java.

source

Java468x60
By |2019-09-25T22:45:25+00:00September 25th, 2019|Java Video Tutorials|30 Comments

30 Comments

  1. jvsnyc September 25, 2019 at 10:45 pm - Reply

    I was so wired into the old, pre-Java 5 ways of file reading that I never had done this, being stuck on Auto-pilot. This is a good bit cleaner and neater. I now realize when I complained how bothersome file I/O was in Java, my Java-loving friends thought I was being overly negative. They thought I was still complaining about this. I wish they asked "have you tried using Scanner?" instead of shrugging.

  2. Harshavardhan Kaduru September 25, 2019 at 10:45 pm - Reply

    Just love the way you explain it , i am trying to learn Java slowly and your tutorials gave me a boost …i can say to learn it more quickly and grasp thoroughly….Thank You John

  3. Dom September 25, 2019 at 10:45 pm - Reply

    I'm using windows 7, Netbeans ide and dragging the text file to the project doesnt work in netbeans, so i made a separate package in the same project where I wrote the codes and where i also dragged the text file, but it did not work when I ran it it says "cannot find file specified". what can I do ? Thanks!

  4. Guram Kankava September 25, 2019 at 10:45 pm - Reply

    Thank you very much.

  5. SleepySam September 25, 2019 at 10:45 pm - Reply

    Hey John! I noticed you have a hungarian keyboard layout! Any particular reason for that? Is it only because your laptop is from Hungary?

  6. Heat4Life September 25, 2019 at 10:45 pm - Reply

    This is some awesome stuff!!! Thank you! I really want all of this Knowledge so Bad!!! xD

  7. Vali Stadnikov September 25, 2019 at 10:45 pm - Reply

    Thank you!!!

  8. Zin September 25, 2019 at 10:45 pm - Reply

    Why do feel like hes high? Like wtf use something less classic

  9. The Legend September 25, 2019 at 10:45 pm - Reply

    turn off the MUSIC gosh…..noisy neighbors

  10. Aremenianwithlegs _ September 25, 2019 at 10:45 pm - Reply

    What is happens in this code:

    File name = new File(fileLocation);

    I can gather that it's storing the location as an argument for the file class to take care of, but I just want to be sure.

  11. gsharpshooter80 September 25, 2019 at 10:45 pm - Reply

    Excellent tutorials John! I have a problem though on this one (It's actually the same problem as Chuck Asher's comment 2 comments below this one!) Anyways I'm on a Mac do these tutorials with eclipse (if that helps) and I'm getting an error at Scanner in = new Scanner(textFile); The IDE is spitting out "Unhandled exception type FileNotFoundException". Any idea's John (or anyone really), thanks again and the tutorials are very helpful!

  12. Chuck Asher September 25, 2019 at 10:45 pm - Reply

    John, I am trying to do Part 33 of your Java for Beginners tutorial and the program stops on line 14 (Scanner in = new Scanner(textFile);. Eclipse does not indicate that there is an error until runtime when everything stops on line 14. I have tried everything that I know to do to no avail. Help!

  13. Richard Puth September 25, 2019 at 10:45 pm - Reply

    Great tutorials !

  14. Rajesh Choudhary September 25, 2019 at 10:45 pm - Reply

    u r really a great tutor. 

  15. SteakBarker September 25, 2019 at 10:45 pm - Reply

    Instead of in.nextInt(); why dont you do : Integer.parseInt(in.nextLine()); and just surround it with a try

  16. VeslorTV September 25, 2019 at 10:45 pm - Reply

    Thanks!

  17. M ALI September 25, 2019 at 10:45 pm - Reply

    How to put the Path in Linux .. I am on Fedora

  18. Keith Kleiner September 25, 2019 at 10:45 pm - Reply

    good stuff. going to finish all of these beginners videos by the end of this week! I can't believe more people haven't watched your videos. I'm telling everyone about them.

  19. Burak ÖNER September 25, 2019 at 10:45 pm - Reply

    awesome

  20. Faiz MK September 25, 2019 at 10:45 pm - Reply

    Clear!!! …Thanks 🙂

  21. Navdeep Singh September 25, 2019 at 10:45 pm - Reply

    Grate  tutorial  !! Thnxxx,  i was just looking for that ,,,,,, 

  22. BR_0309 September 25, 2019 at 10:45 pm - Reply

    I have warcht i lot of tutorials about this, but i learnt the most frome yours!! Keep on going XD

  23. Nick September 25, 2019 at 10:45 pm - Reply

    awesome tutorials
    have a question though
    how would you sort a random list of numbers or strings in a file

  24. Bablu Gupta September 25, 2019 at 10:45 pm - Reply

    Hi John Awesome and Hats off to you you made my concept clear to greatness to you
    I am reading all your tutorials it's helps me a lot and make confidence that i can do a good programming in java…….Happy

  25. Gonzalo Gasca Meza September 25, 2019 at 10:45 pm - Reply

    Hi John, I will be reading files around 100MB each, (Log files) what would be the method you recommend, I will be reading Line by Line to identify specific pattern, any suggestion for particular method?

  26. TheRiL3z September 25, 2019 at 10:45 pm - Reply

    This channel is amazing, especially for beginners like myself who've only been programming for about a year. Never stop making these videos, as encountering such clear instruction is a rare occurrence among most programming tutorial series I end up stumbling upon on youtube.

  27. Cave of Programming September 25, 2019 at 10:45 pm - Reply

    Thanks for all the great comments! I love it!!

  28. saturnineNL September 25, 2019 at 10:45 pm - Reply

    From all tutorials i watch, i enjoy these the most. A good tutorial is not so much what you try to explain, but more in how you explain it. I think John is a real master in that.

    Greets Sat

  29. kraNG- September 25, 2019 at 10:45 pm - Reply

    You deserve more views!

    And since you've taught me something, I'll teach you something.
    Ctrl+S = save

  30. 123japanuser September 25, 2019 at 10:45 pm - Reply

    Hats Off John

Leave A Comment

*