} } //*************************************** 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 RUclips.
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
best teacher ever
!!!!!!!!!!!!!!!!!!!! you made my life easy God bless you and your beloved ones for ever !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Thank you Bro. No confusion, straight to the point, no BS
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!
Your 6-minute video made the bootcamp LMS content much easier to understand. Much appreciated!
probably one of the most comprehensive java tutorials, without cutting corners :D
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
Great Explanation as Always
This was great. My professor is making it his life's work to make sure I dont understand inheritance.
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.
Thanks for making it short and having nothing useless
Super awesome Java tutorial! 👍🏼 I learn a lot from here!
Simple yet an amazing explanation
You made this super simple to understand. Thank you.
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
beautifully explained I really appreciate the turorial, thanks!
Impressed by your teaching skills.
Good video. Thanks for the applied example
Very awesome video
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
Bro just out here saving lives and time. Thanks Bro
You made it extremely easy to understand. Thank you man
Your tutorials are the best there are!
Thank you, can't wait to use this to start my own business
thanks for making it so easy to understand, awesome video, no more neither less information of what i needed
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.
thanks bro, got an assignment due in one week, thanks for the help my guy
stop lying bro im your classmate
Very easiy explaing thank you
Clean teaching... underrated channel bro
Love from Kenya... manze unatuokolea
thank you for enlighten me.. its very useful in my study
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!!! I'm infinitely grateful for your dedication and big heart to share this knowledge with the world. Thank you soo much
You probably the best teacher 🔥
Thanks for this, it has been very easy to grasp the concept with your explanation
Thank you so much for this tutorial!! It was very comprehensive and helpful.
"Sit back, relax, and enjoy the show". Every time when I watch your video, I repeat that with you lol
thank you for the simple video
Great teaching 👏
Liked Commented and subscribed
Awesome! Incredibly clear, unlike my teacher :(
Amazing teaching. Thx
very good video
helpful it is
Very Injecting concept video
Great straight forward explanation. Thank you!
Cool work...👍
Clear and informative. Thanks!
Thanks for this video
Thank you! I enjoyed the explanation of inheritance in just a short video.
Tank you, very excellent explanation
Great video as always, keep the good work !!
The best 👏👏👏👏
marvellous job
teaching was straight to the point bro code!
Thank you for that video......
Your teaching way is very good. Keep it up. Watching from Ethiopia
thx brah... your Java series is legit
bro thank u best tutorial on thye internet
great video
omg! thank you for making it much more easier to understand.
Fantastic video
Cool explanation!!!
Understood, inheritance, which both things have in common. 34th. Thank you, ma Bro Sensei!
I am very Usefull
best tutorial I found Thank you!. You got a new Subscriber
'
Great Class
Great.
Great class, Thanks
Liked and subscribed, great stuff man your content is very helpful
That's really good
splendid
Very useful tutorial!
Thank, great presentation!
I won’t skip any advertisement in order to support u
Great tutorial. Thanks!
Awesome lecture Bro, got my doubts cleared.
Great
Awesome!!!!!!!!!!!!
good go!!
good, good...
Thanks, Bro! ☕ You're awesome!
Cool work!
Nice.
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
Very good course, thank you
Good luck bro
SUPER HELPFUll
Thanks it was very clear.
nicely done
IT IS HELPFULL
good stuff
Nice my bro
heeey bro, i have exam tomorrow and guess what?! you are my savior
keep going
I feel earthquake while you're typing, lol
Thank you for the video, it really helped!