Java toString method 🎉
HTML-код
- Опубликовано: 11 июл 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!!
Your way to explain is the best🙃thanks!
loving the java because of this series of tutorial
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.
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
This channel is incredible!
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
Great stuff, thank you
Great job!
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
Awesome tutorial!
clear and focused, great work Bro!
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!
great video very helpful!!
Great *Bro code*
i am going to download your all java playlist
great explanation
and thank you *Bro* 👍👍👍
sweeeeet! Thanks for watching Muhammad!
Owesome bro i always love your videos
Great explanation bro, thank you
Thanks, Bro! ☕ You're awesome!
Fantastic! Thank you!!
This is something new
great videos
I finally get it lol thanks you have the best explanations I am glad I found your channel!
nice work
simple explanation thank you a lot
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
crystal clear, Thanks Bro
the best java free course available greet work broCode
Thank you very much !!
Great Video!
good teach!thanks bro
Thank you!
wonderful
You are the best thank you♥️
Man you're the best!!!!
Great❤
Thanks 👍😊 bro you are living legend
I like your explanation bruh i think You're The best Teaching I've Ever Seen
Thanks!
Nice!!!
Thanks, bro.
really nice
thank you !!
Well explained Bro!
very good
Awesome
Thank you so much sir.
Thank you.
this was explained so well! thanks bro, ima fellow bro now ;D
You are a legend man
Perfect
Thank you bro!💛
very good🎉🎉🎉🎉🎉
ur the best
You're the BEST 😉
Nice.
I love you BRO!!!! From Russia with LOVE!!!!
great
thank you bro
Nice
coool
thank you my Bro ♥♥♥
thx bro
Thnks senpaii
Thank you! From Ukraine.
nice video, much better than my lecturer did
Cool :)
Thanks :)
Thank u bro
good
nice
Best bro!!!!
goooooooooood work bro thx
Ok, so we can use toString implicitly, without using "make, model, color so on" manually. Completely understood. 30th. Thank you, ma Bro Sensei!
Thanks broseph
Pure bliss
my appreciation
thank you.
Thanks
30th. Thank you, ma Bro Sensei
best bro
ty
Great
Nice Explanation sir
thanks
i lov u bro
👍
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!
Damn! I better understand your tutorials than yt tutorials in my native language. Thank you, great job:)
Yes, it's true.
😘😍😻
like it
Dropping a comment :]
Gratitude from Lithuania
Makes sense
🥰
Ayo, I'm passing Java, thanks!
GOAT
a usual w from the Bro Code