} } //*************************************** public class Vehicle{ double speed; void go(){ System.out.println("This vehicle is moving"); } void stop(){ System.out.println("This vehicle is stopped"); } } //*************************************** public class Car extends Vehicle{ int wheels = 4; int door = 4; } //*************************************** public class Bicycle extends Vehicle{ int wheels = 2; int pedals = 2; } //***************************************
@@marcoslightspeed5517 it gets way more difficult than this, its good he's showing you guys now so that you don't struggle when you actually have to use a lot of classes( which is always especially considering the topic inheritance)
best teacher ever !!!!!!!!!!!!!!!!!!!! you made my life easy God bless you and your beloved ones for ever !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
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
amazing, thank you, so i want to review what i have learned from your tutotiral, a subclass inherits all instance variables and methods from the superclass without redeclaring them in the subclass. we can also add extra instance variables or methods that are different from the superclass. In order to achieve inheritance, the key word extends is used in the class header of the subclass with the name of the super class.
//***************************************
public class Main {
public static void main(String[] args) {
// inheritance = the process where one class acquires,
// the attributes and methods of another.
Car car = new Car();
car.go();
Bicycle bike = new Bicycle();
car.go();
bike.stop();
System.out.println(car.doors);
System.out.println(bike.pedals);
}
}
//***************************************
public class Vehicle{
double speed;
void go(){
System.out.println("This vehicle is moving");
}
void stop(){
System.out.println("This vehicle is stopped");
}
}
//***************************************
public class Car extends Vehicle{
int wheels = 4;
int door = 4;
}
//***************************************
public class Bicycle extends Vehicle{
int wheels = 2;
int pedals = 2;
}
//***************************************
Bro in Vehicle class you use 2 methods name go :) I think one of them is Stop
you repeated the same method (& arguments) for the Vehicle class
Bro inherited awesome teaching skills from parent class.
*cough cough* no.
@@urimsuh why
lol
used 3 classes for a first example lol
@@marcoslightspeed5517 it gets way more difficult than this, its good he's showing you guys now so that you don't struggle when you actually have to use a lot of classes( which is always especially considering the topic inheritance)
You are hands down the best code teacher on UA-cam.
Clear and straight to the point. Thank you
you have no idea how better this video made me feel thank you so much college been really overwhelming so far
Thank you Bro. No confusion, straight to the point, no BS
Tysm for these videos! I love learning how to code but had to drop my Java class to make room for a period of basketball. Now I can do both :)
@Milan Walker i’ve tried it. didn’t work.
best teacher ever
!!!!!!!!!!!!!!!!!!!! you made my life easy God bless you and your beloved ones for ever !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
I spent much time to understand this program but once watching your video made it very simple for me. Thank you so much for this video.
Prayers answered! Most straight forward explanation I’ve seen!
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
Super awesome Java tutorial! 👍🏼 I learn a lot from here!
Great Explanation as Always
This was great. My professor is making it his life's work to make sure I dont understand inheritance.
Your 6-minute video made the bootcamp LMS content much easier to understand. Much appreciated!
Simple yet an amazing explanation
thanks bro, got an assignment due in one week, thanks for the help my guy
stop lying bro im your classmate
Thanks for making it short and having nothing useless
You made this super simple to understand. Thank you.
probably one of the most comprehensive java tutorials, without cutting corners :D
beautifully explained I really appreciate the turorial, thanks!
Bro just out here saving lives and time. Thanks Bro
Nice !!
Great Class
best tutorial I found Thank you!. You got a new Subscriber
'
I love you man, I learn 99% from you and 1% from school
Very awesome video
thanks for making it so easy to understand, awesome video, no more neither less information of what i needed
amazing, thank you, so i want to review what i have learned from your tutotiral, a subclass inherits all instance variables and methods from the superclass without redeclaring them in the subclass.
we can also add extra instance variables or methods that are different from the superclass. In order to achieve inheritance, the key word extends is used in the class header of the subclass with the name of the super class.
you got it
Your tutorials are the best there are!
You made it extremely easy to understand. Thank you man
great video!!! I'm infinitely grateful for your dedication and big heart to share this knowledge with the world. Thank you soo much
Liked and subscribed, great stuff man your content is very helpful
Nice tutorials.. keep on
Bring all kinds of java sessions as animated 5 to 10 min clips
or a 20 - 40 min big sessions
but fundamental and example
Good video. Thanks for the applied example
You probably the best teacher 🔥
Clean teaching... underrated channel bro
Awesome! Incredibly clear, unlike my teacher :(
Thank you, can't wait to use this to start my own business
Cool work...👍
Damn nobody wanted to get straight to the point But you are a very awesome teacher I got a find out more content from you
Great video as always, keep the good work !!
thx brah... your Java series is legit
Impressed by your teaching skills.
Thank you so much for this tutorial!! It was very comprehensive and helpful.
Your teaching way is very good. Keep it up. Watching from Ethiopia
Great straight forward explanation. Thank you!
Thanks for this, it has been very easy to grasp the concept with your explanation
The best 👏👏👏👏
Liked Commented and subscribed
Great teaching 👏
Thank you! I enjoyed the explanation of inheritance in just a short video.
W guy love u, you got a new sub :)
Clear and informative. Thanks!
This video taught me that you need to extend the class itself if you want that subclasses objects to be able to call the method.
bro thank u best tutorial on thye internet
teaching was straight to the point bro code!
Amazing teaching. Thx
Thanks, Bro! ☕ You're awesome!
Awesome lecture Bro, got my doubts cleared.
I became a fellow bro :))))) Love ur vids!
"Sit back, relax, and enjoy the show". Every time when I watch your video, I repeat that with you lol
thank you for enlighten me.. its very useful in my study
Tank you, very excellent explanation
omg! thank you for making it much more easier to understand.
Cool explanation!!!
Very Injecting concept video
marvellous job
Awesome!!!!!!!!!!!!
very good video
helpful it is
Very easiy explaing thank you
Great tutorial. Thanks!
Thank, great presentation!
Fantastic video
Thank you for that video......
Thanks for this video
thank you for the simple video
Thanks bro! excellent video 🏁🏁
thanks for the video! easy to understand and straight to point
Love from Kenya... manze unatuokolea
I love your videos .
Can you make videos on Spring ,Spring boot, hibernate
Very useful tutorial!
great video
You made that look easy! Thank you!!!
I love you and your channel 💙
Thanks Nima!
Great class, Thanks
Great.
Cool work!
this was helpful, thank you bro
Love from India❤
splendid
Found it helpful.Thanks!
Amazing as always.
I feel earthquake while you're typing, lol
Thank you for the video, it really helped!
good go!!
Thanks it was very clear.
Thank you for the great tutorial!
One thing I am wondering about is how I would set the speed for each subclass.
by making its constructor in parent class...& later on i would love to see ur speed
Thnx bro it helps me so gud
good, good...
That's really good