Java toString method 🎉
ฝัง
- เผยแพร่เมื่อ 26 มิ.ย. 2024
- Java toString method tutorial explained
#Java #toString #method #tutorial #explained
//*****************************************
public class Main {
public static void main(String[] args) {
// toString() = special method that all objects inherit,
// that returns a string that "textually represents" an object.
// can be used both implicitly and explicitly
Car car = new Car();
System.out.println(car.toString());
// or
System.out.println(car);
}
}
//*****************************************
public class Car {
String make = "Ford";
String model = "Mustang";
String color = "red";
int year = 2021;
public String toString() {
return make +"
"+model+"
"+color+"
"+year;
}
}
//***************************************** - วิทยาศาสตร์และเทคโนโลยี
//*****************************************
public class Main {
public static void main(String[] args) {
// toString() = special method that all objects inherit,
// that returns a string that "textually represents" an object.
// can be used both implicitly and explicitly
Car car = new Car();
System.out.println(car.toString());
// or
System.out.println(car);
}
}
//*****************************************
public class Car {
String make = "Ford";
String model = "Mustang";
String color = "red";
int year = 2021;
public String toString() {
return make +"
"+model+"
"+color+"
"+year;
}
}
//*****************************************
you dont sound like a Bro
🇿🇦 South African junior Software developers thank you for your service. I have made over 200slides and counting of your full tutorial. You're better than my lecturers.
Very simple, right to the point, clear, no useless blabla.. great video. Thank you so much
I love this comment too!
Best explanation i've come across, thanks!!
loving the java because of this series of tutorial
Your way to explain is the best🙃thanks!
If you're ever struggling with Java in school, just come to this channel and follow this man's video. You're going to understand the materials so much better and possibly make it into development
wonderful
Perfect
ur the best
Great stuff, thank you
Great job!
I like your explanation bruh i think You're The best Teaching I've Ever Seen
Great❤
This channel is incredible!
Awesome tutorial!
Bro I'm reviewing basic stuffs cuz I tend to forget and I just wanna say that you're a godsent to this world. Keep it up man!
Nice!!!
great video very helpful!!
This is the best Java tutorial for beginners, so you can learn Java and English in one hit. Please keep going! I vote for Java advance tutorial. Thanks a lot Bro
It took 1 hour to explain this in lectures.still did not get it. Bro explained it perfectly in 6 mins. God bless you bro
Great explanation bro, thank you
Great *Bro code*
i am going to download your all java playlist
great explanation
and thank you *Bro* 👍👍👍
sweeeeet! Thanks for watching Muhammad!
Thanks, Bro! ☕ You're awesome!
This is something new
clear and focused, great work Bro!
great videos
crystal clear, Thanks Bro
One time i had a mistake when i saw the 82'th clip in ur list, and then, i realized and watched again at the first video, i easily to understand. That's a amazing :D Thanks guy for sharing
nice work
Fantastic! Thank you!!
Shit dude I just discovered your channel and it is sooo helpful (I like how you explain stuff simply and make it easy to understand) . Keep helping people like this and I'm sure your channel will grow (you definetly deserve more than 5K subscribers)
thanks Ruben!
lol he had 5K suscribers 1 year ago? Definitely he grew up! ^^
lol now he has 600k!
@@gaminggoddessaria Well he now has 1 MILLION !
And now there are 1.5 million subscribers.
good teach!thanks bro
simple explanation thank you a lot
Owesome bro i always love your videos
Man you're the best!!!!
Great Video!
the best java free course available greet work broCode
Thank you! From Ukraine.
Awesome
Thank you!
I finally get it lol thanks you have the best explanations I am glad I found your channel!
Thanks 👍😊 bro you are living legend
Thank you very much !!
my appreciation
You are a legend man
Thanks, bro.
Nice.
Thanks!
I love you BRO!!!! From Russia with LOVE!!!!
You are the best thank you♥️
Thank you so much sir.
thank you bro
Thnks senpaii
thank you !!
Thank you bro!💛
You're the BEST 😉
Thank you.
thank you my Bro ♥♥♥
best bro
great
coool
like it
thx bro
very good
30th. Thank you, ma Bro Sensei
really nice
this was explained so well! thanks bro, ima fellow bro now ;D
Thanks broseph
Thanks
Makes sense
Thank u bro
Thanks :)
nice video, much better than my lecturer did
Cool :)
thanks
👍
Nice
very good🎉🎉🎉🎉🎉
Ayo, I'm passing Java, thanks!
Pure bliss
thank you.
Well explained Bro!
Best bro!!!!
😘😍😻
Ok, so we can use toString implicitly, without using "make, model, color so on" manually. Completely understood. 30th. Thank you, ma Bro Sensei!
nice
bro @ 1:53 i typed sysout(pizza) from the overloaded constructor lesson and came with similar answer I was like "java shouldve created a code for easier access" , and behold the answer to that problem is this lesson lmao, I like your tutorials bro have a nice day!
i lov u bro
Damn! I better understand your tutorials than yt tutorials in my native language. Thank you, great job:)
Yes, it's true.
Dropping a comment :]
Gratitude from Lithuania
goooooooooood work bro thx
ty
good
🥰
a usual w from the Bro Code
Nice Explanation sir
GOAT
Dang I can’t be the only one that’s been calling my objects variables by print lines this entire time 😂 I feel silly now