public class Main { public static void main(String[] args) {
// FileReader = read the contents of a file as a stream of characters. One by one // read() returns an int value which contains the byte value // when read() returns -1, there is no more data to be read
try { FileReader reader = new FileReader("art.txt"); int data = reader.read(); while(data != -1) { System.out.print((char)data); data = reader.read(); } reader.close();
Thank you so much for this tutorial. Your code does not work.:( Here is mine: import java.io.FileReader; import java.io.IOException; public class Main{ public static void main(String[] args){ try{ FileReader reader = new FileReader("lyrics.txt"); int data = reader.read(); while(data!=-1 ){ System.out.println((char) data); data = reader.read(); } reader.close(); }catch(FileNotFoundException e){ e.printStackTrace(); }catch (IOException e){ e.printStackTrace(); } } } There's also an issue with my code. I get this error message: "error(s).Main.java:17: error: cannot find symbol }catch(FileNotFoundException e){ ^ symbol: class FileNotFoundException location: class Main 1 error" If anyone knows how I can fix my code, kindly let me know.
Your videos are so helpful bro. Not only do your videos make so much more sense than any googling or even courses I can take, but you make so many of them and you even copy your code down in the description?! You definitely make the best coding tutorials out there. Thank you for the hard work and dedication!
Watching this from Dhaka,Bangladesh. i have a request,bro.Please,make a video on how to securely Lock file (like zip-folder do) using java-swing (not just making the file read-only) & keep this good work continuously.
Hey man doubt you will see this, u have been very helpful to me, but this just wont work for me, it just keeps saying it cannot find the file. I have no idea what to do and I’ve been struggling in this 6 week summer class for college!
nope all file video lessons not working :(, to bad this happens I follow step by step no file in java folder can be seeing but he there no output on console
if i got a file , and it conatins the numbers as 2, 57 7, 78 8,35 how do i read the file and store the 1st and 2nd column in 2 different arrays? please reply its urgent
Yo just wanna say that GOD loved the world so much he sent his only begotten son Jesus to die a brutal death for us so that we can have eternal life and we can all accept this amazing gift this by simply believing in him (Jesus) asking for the forgiveness of your sins and forming a relationship with heavenly father.
public class Main {
public static void main(String[] args) {
// FileReader = read the contents of a file as a stream of characters. One by one
// read() returns an int value which contains the byte value
// when read() returns -1, there is no more data to be read
try {
FileReader reader = new FileReader("art.txt");
int data = reader.read();
while(data != -1) {
System.out.print((char)data);
data = reader.read();
}
reader.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
Hey bro can you make a tutorial on playing sounds in java? I want to add some music and sound effects to my GUI...
Love this channel.
Thank you so much for this tutorial.
Your code does not work.:(
Here is mine:
import java.io.FileReader;
import java.io.IOException;
public class Main{
public static void main(String[] args){
try{
FileReader reader = new FileReader("lyrics.txt");
int data = reader.read();
while(data!=-1 ){
System.out.println((char) data);
data = reader.read();
}
reader.close();
}catch(FileNotFoundException e){
e.printStackTrace();
}catch (IOException e){
e.printStackTrace();
}
}
}
There's also an issue with my code.
I get this error message:
"error(s).Main.java:17: error: cannot find symbol
}catch(FileNotFoundException e){
^
symbol: class FileNotFoundException
location: class Main
1 error"
If anyone knows how I can fix my code, kindly let me know.
@@joyceasante8292 i think you forgot to add
import java.io.FileNotFoundException;
Issue fixed! Thanks@Chan.
import java.io.FileReader;
import java.io.IOException;
import java.io.FileNotFoundException;
public class Main{
public static void main(String[] args){
try{
FileReader reader = new FileReader("lyrics.txt");
int data = reader.read();
while(data!=-1 ){
System.out.println((char) data);
data = reader.read();
}
reader.close();
}catch(FileNotFoundException e){
e.printStackTrace();
}catch (IOException e){
e.printStackTrace();
}
}
}
Your videos are so helpful bro. Not only do your videos make so much more sense than any googling or even courses I can take, but you make so many of them and you even copy your code down in the description?! You definitely make the best coding tutorials out there. Thank you for the hard work and dedication!
Bro, ill never get tired of saying you're the besssssssssssssst.
He makes Java very easy to understand thanks bro keep writing code!!!
thanks for the video bro..
i had no idea about ascii art
You can write some text too. I thought the art would be fun
Nice short of video, easy to learn. 👍👍
Bagus sekali penjelasannya. 👍👍😎
Am I the only one who noticed that in 1:28 our bro has the Nuclear lunch codes folder ? ahahah
No you aren't
Really amazing work!
gotta try catch them all. nice video bro
Amazing vid
Tysm i'm going to my final exam with understanding from your codes
Can you make XML tutorials please?
Yoh bro I've been meaning to ask, what is e.printStackTrace()?
It will print the exception that occurs
Watching this from Dhaka,Bangladesh.
i have a request,bro.Please,make a video on how to securely Lock file (like zip-folder do) using java-swing (not just making the file read-only) & keep this good work continuously.
Круто! Я не очень хорошо знаю английский, но я все понимаю. Спасибо)
Nice, bro!
Thank you for this very useful video!
Great video as always
Hi Brroooooo! You are the best
Thank you for being on RUclips. Your saving me while I take 261 ❤😂😅
drop a comment below!!
damn that ending HEY YOU got me
LIKED
Leaving a comment for the algorithm
I like my lectures like I like my beer: clear and inspiring
Adding comment for support.
Thank you Bro from Morocco : )
Why reader.read(); didnt stop unless we put into data variable ?
cool stuff
Thanks bro. Simple and perfect explanation.
super
Thanks, Bro! ☕ You're awesome!
Great and simple
Hey man doubt you will see this, u have been very helpful to me, but this just wont work for me, it just keeps saying it cannot find the file. I have no idea what to do and I’ve been struggling in this 6 week summer class for college!
this was helpful, thank you
awesome🙌 thank you
Nice
awesome channel! thanks!
Appreciated work❤
Amazing video, would you consider doing a json reader?
U are a Hero
You are a GOAT
best broo
nice vid
Thanks again, bro 😎
dope video
Happy brother's day bro
❤️❤️❤️❤️
can't run even if i copy your program and created same file
FileReader fr = new FileReader("C:\\Gfg.txt"); try giving full location
Thank you so much sir.
Hyo Bro 👌, well simplified
thank you Mon Wil!
I want to become a fellow bro
Thanks ;)
Thanks bro!
Thanks
Thanks bro.
nope all file video lessons not working :(, to bad this happens
I follow step by step no file in java folder can be seeing but he there
no output on console
Thank!
Thanks, Bro!
free Palestine
Is nobody going to talk about the fact he has nuclear launch codes saved on his desktop?
if i got a file , and it conatins the numbers as
2, 57
7, 78
8,35
how do i read the file and store the 1st and 2nd column in 2 different arrays? please reply its urgent
thanks bro
thanks
Thanks bro
thanks for watching chadie!
i have a problem in my eclipse the auto generated doesn't appear i have to write it anyone can help me
Chat bot Ai, you can literally……..🗣🔥
Bro Code
Can You Make A multi account login Form
or registration form for console Tutorial?
anyone know why after i run this the image is shown for like a second and then it disapperead?
i even tried it with bro's code and it didnt work
💯
Yooooo😂
gg
THANKS ALOT )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
why cant i use the read method
ahhh it just shows a bunch of number instead of words
One more to go to make this happen by doing code...
but i dont pray
Bro? 😳
I would like the video butt, u know, 420
comment
Yo just wanna say that GOD loved the world so much he sent his only begotten
son Jesus to die a brutal death for us so that we can have eternal life
and we can all accept this amazing gift this by simply believing in him (Jesus) asking for the forgiveness of your sins
and forming a relationship with heavenly father.
bro
Not well explained for a beginner
I don’t think it gets much easier than that, maybe you need to review some core concepts first.
Read About Islam Bro
😀
Nice
Thanks, Bro!
Thanks
thanks bro
thanks
thanks