//***************************************** 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;
🇿🇦 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.
Well explained, mate! The info that toString() is called each time you use println to display an object, without the need of writing it down, was my gold nugget in this video! Thanks for that and keep on!
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)
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
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
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
so resuming everything,tostring() prints the memory address of an instance of a class (an object) and we can override that method to print whatever we want, usually it's used to print all the instance variables of an instance of a class.
I am a bit confused why the method had to be public. if you are calling a method from another class it doesn't have to be public. I experimented a little and apparently it only has to be public if the method is name toString, if its named anything else it works just as a normal void method.
//*****************************************
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!!
Well explained, mate! The info that toString() is called each time you use println to display an object, without the need of writing it down, was my gold nugget in this video!
Thanks for that and keep on!
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.
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
loving the java because of this series of tutorial
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
simple, to the point, nice speed of speaking and teaching, trains of thought very nice to follow, accentuation when speaking also great. thanks mate.
Awesome video, understood clearly
Thanks bro Code
Your way to explain is the best🙃thanks!
great video!!! I'm infinitely grateful for your dedication and big heart to share this knowledge with the world. Thank you soo much
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
clear and focused, great work Bro!
Great *Bro code*
i am going to download your all java playlist
great explanation
and thank you *Bro* 👍👍👍
sweeeeet! Thanks for watching Muhammad!
Great stuff, thank you
simple explanation thank you a lot
Amazing BRAVO 👏
I like your explanation bruh i think You're The best Teaching I've Ever Seen
the best java free course available greet work broCode
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!
Owesome bro i always love your 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
Great job!
Great Video!
Thanks 👍😊 bro you are living legend
Thank you! From Ukraine.
Ok, so we can use toString implicitly, without using "make, model, color so on" manually. Completely understood. 30th. Thank you, ma Bro Sensei!
great video very helpful!!
I love you BRO!!!! From Russia with LOVE!!!!
This is something new
good teach!thanks bro
really nice
Awesome tutorial!
This channel is incredible!
keep up the good work Bro you are the best
can you create a swing java video
You are a legend man
ur the best
great videos
Pure bliss
Nice!!!
Thanks, bro.
Cool :)
Thanks bro
You are the best thank you♥️
Great❤
Damn! I better understand your tutorials than yt tutorials in my native language. Thank you, great job:)
Yes, it's true.
Great explanation bro, thank you
so resuming everything,tostring() prints the memory address of an instance of a class (an object) and we can override that method to print whatever we want, usually it's used to print all the instance variables of an instance of a class.
Thanks, Bro! ☕ You're awesome!
Thank u bro
You're the BEST 😉
wonderful
goooooooooood work bro thx
nice video, much better than my lecturer did
Perfect
Thank you so much sir.
nice work
30th. Thank you, ma Bro Sensei
Thank you very much !!
my appreciation
I am a bit confused why the method had to be public. if you are calling a method from another class it doesn't have to be public. I experimented a little and apparently it only has to be public if the method is name toString, if its named anything else it works just as a normal void method.
if you write void method you cant return nothing, without return you could,
Nice Explanation sir
Awesome
Man you're the best!!!!
Great
Nice.
thx bro
very good
Thanks broseph
Fantastic! Thank you!!
Best bro!!!!
Thanks
like it
thank you my Bro ♥♥♥
Thnks senpaii
Well explained Bro!
Thank you!
great
Thank you.
Thanks!
I finally get it lol thanks you have the best explanations I am glad I found your channel!
Gratitude from Lithuania
best bro
thanks
coool
Nice
👍
thank you.
thank you !!
Makes sense
i lov u bro
this was explained so well! thanks bro, ima fellow bro now ;D
Thank you bro!💛
😘😍😻
good
Thanks :)
Dropping a comment :]