This is the first time i feel like i'm understanding everything in a coding tutorial. Your steps are so clear and you don't skip anything. You don't make anything complicated and show it as simple as it is. Perfect video. Thank you so much John, i hope you have a nice day!
@antunes6239 Жыл бұрын
YHEAA i'm from Brazil,and by the first time,i understood how this work
@dushanchanuka19414 ай бұрын
Same here🎉😅
@ErikHansenDrums3 жыл бұрын
really astounded that there aren't more clear cut tutorials/explanations about buffered reader/writer on YT. Thanks for the video!
@misaelpereira96792 жыл бұрын
For anyone that does not know, you can use "try with resources" instead of closing the buffered items (and everything that implements closeable interface)
@flameyosflow_4834 Жыл бұрын
In the latest java versions at least, you can only use try-with-resources when something implements AutoClosable
@illegalgiant_ Жыл бұрын
I've worked in this industry for years but as a lower level tech employee and am needing to brush up again. These tutorials are just fantastic. If you can understand why you'd do things this really clears up the rest. To boot, they are really concise and nicely made. Thanks man I do appreciate it.
@dasikalyan2 жыл бұрын
Yeah.. as someone pointed out.. try-with-resources is a good way to show best practice for any resource that implements closeable .. something like this try (BufferedWriter writer = new BufferedWriter(new FileWriter("output.txt"))) { writer.write("Writing to a file"); } catch (Exception e) { e.printStackTrace(); }
@OmnispectiveHub2 жыл бұрын
Perfect video. I can't begin to explain to you the confusion college classes give when explaining this type of stuff. Its great to have you as a resource for learning what they lack to teach properly. Much thanks, John.
@shanisb952 жыл бұрын
Each time I am struggling with a notion on CodeGym I am on the lookout for one of your videos. And each time it gets crystal clear when you explain it. Thank you so much for your work !
@Jmarthecat2 жыл бұрын
You have no idea how happy I am when I search something related to Java and your video pops up.
@marksummers95438 ай бұрын
you just help me finish a whole assignment in two hour over 3 videos, i appreciate you
@HolyApplebutter Жыл бұрын
You're an absolute god-send. I've been struggling with these last couple weeks of the semester, but you're able to explain these concepts so easily with clear examples to help walk us through them. You're great!
@TherealShacharTs9 ай бұрын
We were given an assignment to code all kinds of shapes, and the lecturer deliberately did not teach how to save files. And I asked him why they don't teach, but they did put it in the assignment, he said he wants us to learn to code and think twice about how everything works, only after watching your video, I understood the meaning of why he wanted it, there won't always be someone next to you to tell you, this is the stage you need study alone and look for answers
@findlestick3 жыл бұрын
What? A concise, clearly-explained tutorial on KZbin? Subbed. 👍
@hkkabir20242 жыл бұрын
thank you for your excellency. now i don't need to check anywhere for reading and writing file. Millions of thanks
@turboheadcrab6662 жыл бұрын
This is the easiest way to understand the I/O. The university teacher and other youtubers make this a tedious topic, but you made it so much easier. Thanks a lot!
@justinliu77882 жыл бұрын
You should close the resources in finally block or use a try with resources to guarantee the resources are closed. If you don't do this and there is some exception while running the writes, the resource will never be closed.
@konstantinzakharov5643 Жыл бұрын
I watched this video, wrote some code and it works, Now I can reaaly write to and read from a file. Finally I wrote something that works. Thanks John!
@AdamZX1 Жыл бұрын
Hey John, regarding the 'while' loop, I'd rather simply implement it using '.ready()' i.e.: while (reader.ready()) System.out.println(reader.readLine()); Which does exactly the same thing as your code. Thank you for the great content and best regards !
@poorpanda9033 Жыл бұрын
Woah! This is great. Thanks for sharing !!
@lamiabakli35686 ай бұрын
watching this right before my OOP exam, you're a life saver
@limitless9483 Жыл бұрын
As a JS engineer after starting to learn JAVA I've been wondering why every JAVA tutorial is recoreded in 320p quality with shitty audio !!!! finally a java tutorial with JS tutorials standards lol thank you so much.
@dilln21583 жыл бұрын
Amazing, thank you for making this, very engaged with your viewers. This man is going places!
@nelsoncoop3774 Жыл бұрын
if you create a PrintWriter instead of BufferedReader it comes with the normal print statements (print, println, printf) which is much easier and more familiar
@WannaBeProgrammer2 жыл бұрын
This is the first educational video I have slowed down the playback speed because I want to get every detail possible.
@rajacharya1842 жыл бұрын
thanks man you are like a savior in the hard times almost makes me wanna cry
@AlexandreJasmin2 жыл бұрын
This would be a good place to use Java’s try-with-resources statement which automatically close the file when leaving a code block. For a small program like this, main() can also be declared as “void main(String[] args) throws IOException” which would end the program and print a stack trace in case of error.
@mbbthree Жыл бұрын
Thank you! I kept getting a blank output, just needed to close the writer. God bless!
@dewy3678 ай бұрын
Thanks alot! So much easier than reading a lecture note when you have such an in depth summary
@oswaldovirto5896 Жыл бұрын
You always come in clutch John. I was taught how to do this a year ago and I haven't had to use it since but this was a great refresher. Thank you!
@mykevdc2 жыл бұрын
You make it so easy to understand, thank you!
@achellous8900 Жыл бұрын
A very beautiful and calm way of redirecting knowledge! Respect
@Rosie-gj1pt Жыл бұрын
More clear than my teacher's explanation regarding Java IO! Thanks for the video so much❤
@InvinciRD Жыл бұрын
Pls upload more vdos as i cant afford to spend more online .... You are my only hope towards fun learning...pls make every type vdo related coding ... i will watch and learn them all..
@dilln21583 жыл бұрын
This man is going places
@Another0neTime2 жыл бұрын
Thanks, John. This was clear, concise, and educational.
@marlon441510 ай бұрын
Your way of explaining is very good. You kinda like go through the way of thinking, your explanation is in a very logical order. I'm very impressed, very good 👍🏻
@nikhilsaimunagala22322 жыл бұрын
This video really helped me learn File Input/Output properly. Btw, does it matter whether we choose File or Buffer Reader & Writer?
@HelicopterRidesForCommunists2 жыл бұрын
Man, I keep finding great video lessons like this that do a better job of explaining and teaching than my own PROFESSORS do. It is fucked up how expensive College is for what we get out of it aside from "certification", essentially, and a way to officially show we have taken the courses.
@jacobkurek53662 жыл бұрын
Thanks for the great video. I'm a freshman in college studying CS and videos like this really help me get my projects done on time.
@tazorun2 жыл бұрын
정말 좋은 수업 매일 매일 듣고 있습니다. 감사합니다. SUper easy to study.
@18kroger5 ай бұрын
You nailed it. A crystal clear explanation.
@mastershonobi1103 жыл бұрын
Ok, this videos was awesome. Currently taking Udemy’s “Java Programming Master Class” it’s very in-depth…and I’m always looking for Channels/videos like your to fill in the gaps and give a different/simpler explanation on what seems to be complex topics. You should offer private lessons in addition to your Course. IMHO. 🙌🏿🙌🏿🙌🏿
@CodingWithJohn3 жыл бұрын
If I can figure out a good way to do that when I have time, that's certainly an idea!
@mastershonobi1103 жыл бұрын
@@CodingWithJohn I think it would be a very complimentary “course” for that course if nothing else. Just A Thought…. P.S. I will be visiting your other vids to reinforce and fill in the gaps in other topics/areas in Java. e.g “LinkedList” ans pointers lmao..
@DragonOfTheWest4123 жыл бұрын
@@mastershonobi110 hey I’m taking that same class.
@mastershonobi1103 жыл бұрын
@@DragonOfTheWest412 how far in are you???
@DragonOfTheWest4123 жыл бұрын
@@mastershonobi110 section 8 almost on 9 how about you ?
@shantanupanditiitdelhi5515 Жыл бұрын
Very fantastic sir, the you was explaining that show how much you are cleared about concepts, thanks again master !!
@RealCasualTrash3 жыл бұрын
Amazing work man! Helps a lot for revising(Learning everything from scratch) for uni exmas! Keep it up!
@tanakamusungare65462 жыл бұрын
Thanks for making this concept much more understandable
@zeppelinmexicano11 ай бұрын
It's good to have a "go to" set of objects/methods for this kind of work. I like the BufferedReader/Writer approach and if I'm not mistaken it will even scale up and allow an efficient job with larger data.
@takeover6056 Жыл бұрын
Thank you so much. You explain everything so easy and methodically. I am learning Java in Stockholm Sweden. Have a good evening!
@skotosei9948 Жыл бұрын
YOU ARE THE GOAT BRO TY, AM FRENCH STUDENT AND YOU HELP ME SO MUCH, love you
@kamui7424 Жыл бұрын
Thanks for this bro, beginner here, and this really helped me a lot.
@BlueIsLeet Жыл бұрын
It's better to use try with resources because close() may not get called if the readLine() or write() throws an exception
@vidyar1572 Жыл бұрын
Very Helpful Video. Please do a video on Serialization and De-serialization in JAVA with relevant examples. Thanks
@asmewilliams71174 ай бұрын
At 2:30, actually the set is written on the fly even without the close() method being called. Edit: My bad, I used a Try With Resources, that's why I didn't need to call close() which is called automatically with TWR.
@redcrafterlppa3032 жыл бұрын
That is an old and complicated way. The easiest way is to just put your lines in a list and call : Files.write("path","your list") ; That's all. You also need to handle the ioException though. Reading is simple too: List lines = Files.read("path").collect(Collectors.toList());
@francis.joseph2 жыл бұрын
will there be any performance issues if we use this
@redcrafterlppa3032 жыл бұрын
@@francis.joseph I'm not sure but a raw loop with a filewriter is probably faster. But the point in this method is simplicity and reliability. Also 9/10 such performance differences are not important. If you write to a file many times a second you should think about refactoring the code and buffer the data.
@priyanalpat2 жыл бұрын
I am a fan of your classes, simple and advanced. god job. Keep going
@mustafaturgut9930 Жыл бұрын
I like the way you make every topic in java easy to understand. Please do more java videos
@sintumavuya7495 Жыл бұрын
You were so clear and easy to understand. Thank you.
@ouhyeap3152 жыл бұрын
When I see your videos feels like Java is too easy but when I go to actually programming my brain just reseted
@madfilmer4349 Жыл бұрын
Super method of teaching,able to understand hard concepts though..
@sararara72532 жыл бұрын
I heart you John! You make learning Java clear and understandable. Thank you for helping me learn more and drink less...(coffee). Cheers!
@GourmetBytes Жыл бұрын
lol, shameless plug of your course at beginning.... I hear less than 3 min of you speak and now I'm looking at that course like it's a nicely made steak dinner! Fantastic content! Both java knowledge and ability to teach!!!
@snoopie512 жыл бұрын
Thanks for being very understandable and simple, I’ve been kinda struggling with this.
@doniagasmi21922 жыл бұрын
you make everything clear and simple. Thank you!
@bultibulti67169 ай бұрын
Can you please create a video to compare ip/Op .xls file with some transformation logic applied.
@PROS3KUTOR2 жыл бұрын
If someone doesn't wanna deal with a try-catch block everytime you wanna create or read a file, simple declare your main function like this: public static void main(String args[]) throws IOException { ... //Your code goes here }
@lyn89642 жыл бұрын
oh, finally understood this topic, thanks! You are the best Java teacher!
@sudheereddy61822 жыл бұрын
You are one of the best who made this reader and writer concept look so simple and I really appreciate you work and effort. Thank you !
@abzzz-y7o Жыл бұрын
I have never seen a tutorial like this. Very cool
@simplestep54493 күн бұрын
but what if the text made of a lot of paragraphs and it needs an empty line whenever has a new paragraph, will the read code still works? anyway, great video, thanks sir John!
@anushka.narsima2 жыл бұрын
Your videos are so clear and concise, tysm!
@janfeyen592 Жыл бұрын
clear, concise and honestly reminds me that Java can be easier to manage than C
@CodingWithJohn Жыл бұрын
It's been about 15 years since I've needed to code in C and I can't say I've missed it
@janfeyen592 Жыл бұрын
@@CodingWithJohn haha
@raandomplayer8589 Жыл бұрын
Watching this for advent of code. Thanks!
@raandomplayer8589 Жыл бұрын
Update: I can't do it. 😢
@mr.schrodinger76 ай бұрын
diificult concepts seem very ease when they are taught by u
@tamalmazumder847629 күн бұрын
Thanks...Have a nice day!!
@Garrison862 жыл бұрын
thank you, that was super easy to follow
@wcaleniekubaa2 жыл бұрын
I like PrintWriter instead, it's like System.out You can also use in constructor parameter File class, or File name
@johntravolta26552 жыл бұрын
I just can't stop watching you! Keep it going :)
@dinohunter71762 жыл бұрын
I love your videos, straight on point and easy to understand.
@paulallen46222 жыл бұрын
John your videos are amazing and helping me so much with my studies in software development! Keep doing what you are doing!
@boyneverstop2 жыл бұрын
This is very useful! Thank you for making this video!
@darkojitsu Жыл бұрын
John, this is awesome! I really appreciate this tutorial.
@blind1936 Жыл бұрын
Always used scanner for this sort of things, and when I first time saw this monstrosity of a code at algorythmic test, I was terrified. Thanks to your tutorial now I uderstand it is preatty useful and easy to use. Thanks a lot and keep up the good work.
@anjelomanoranjan Жыл бұрын
I like ypu channel very much!!! You are my favorite englishspeaker youtube bloger, who makes Java Tutorials!!!
@a1rman9063 ай бұрын
listen here u bastard. my professor has tried to teach it but couldnt make it that clear as u do it. u really are the goat.
@larbesabdellah70794 ай бұрын
Why u didn't included the reader and writer inside parentheses within try block when creating it like this : try (FileWriter writer = new FileWriter(path){// code} , this way no need to close the obj it will be done automatically, same for the the reader
@FireDragon912452 жыл бұрын
im using a print writer most of the time
@canhle39702 жыл бұрын
Thanks a lot, John. You're really my saver there on my way to master Java !!!
@recipeFor2 жыл бұрын
Your videos are always needed. Thanks
@kunpeng86462 жыл бұрын
John, god bless you! You are a amazing teacher!
@ShermukhammadKarimov7 ай бұрын
thanks for clear explanation.
@maroofraktim2933 ай бұрын
You're a gem. Keep going brother. Subbed.
@ibrokemyownheart495311 ай бұрын
its telling me that reader cannot be solved. I'm using VS Code
@arthurdirnberger59462 жыл бұрын
First of all, this is a great video but I have a problem: how can I write to a File without deleting anithing that was in the file previosly?
@sheelaaprameya3432 жыл бұрын
Use this code. Pass output file name as well as "true" parameters for the file writer object. The true signifies boolean "append" = true. BufferedWriter writer = new BufferedWriter(new FileWriter ("Output.txt", true));
@areukiddinme84382 жыл бұрын
cant you throw an ioexception instead of a try catch ? also is it okay to use a hasNextLine in the while loop?
@simplified-code11 ай бұрын
I just found my Java tutor, thank you God
@anomolisagag22704 ай бұрын
Is there a chance we create bufferedReader, FileReader, bufferedWriter, FilerWriter from scratch? i mean are bufferedReader, FileReader, bufferedWriter, FilerWriter built-in functions?
@DuderMcDudenstein Жыл бұрын
Strangely, if, rather than declaring a String line which is then repeatedly reassigned as the value of the reader.readLine() method call, you instead just write: while (reader.readLine() != null) then it doesn't work correctly...
@fumano2679 Жыл бұрын
quick question from someone who wants to learn with best practice in 7:55 you make a comparison and declaration in the same line, wouldnt it be 'better' to use a do while loop where you declare in the do scope and compare in the while condition? like: String line; do { line = reader.readLine(); } while (line != null) EDIT: i just saw that if line is null in my example it would still print it, so is the solution in the video best practice? i face those situations a lot where you have something you would like to declare in the loop but also need it as a condition to end the loop and giving it an initial value is kinda boilerplate code since you have the loop for this, would like to get someone else's opinion on that. Thanks
@arush55966 ай бұрын
felt like I understood a lot, but can you make a video about solving some mediocre level questions of file handling
@elielberra2867 Жыл бұрын
Your tutorials are amazing, thank you so much!
@renejacques82882 жыл бұрын
Hi, I'm a bit confused that the file doesn't show on Eclipse, but it does in File Explorer. File explorer also has a bin dir that I don't see in Eclipse, I don't know if you can comment on that as well. Thanks. Great video.