//*************************************** 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; } //***************************************
@matinmonshizadeh2 жыл бұрын
Bro in Vehicle class you use 2 methods name go :) I think one of them is Stop
@patrickstar85852 жыл бұрын
you repeated the same method (& arguments) for the Vehicle class
@shyam.upadhyay2 жыл бұрын
Bro inherited awesome teaching skills from parent class.
@urimsuh2 жыл бұрын
*cough cough* no.
@hamzawarsi18342 жыл бұрын
@@urimsuh why
@tpkowastaken10 ай бұрын
lol
@marcoslightspeed55179 ай бұрын
used 3 classes for a first example lol
@dodgevanniel012 ай бұрын
@@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)
@hanac55862 жыл бұрын
Clear and straight to the point. Thank you
@user-ux9kj4tc5p3 ай бұрын
You are hands down the best code teacher on KZbin.
@cosecE2 жыл бұрын
you have no idea how better this video made me feel thank you so much college been really overwhelming so far
@satvikraval357111 ай бұрын
Thank you Bro. No confusion, straight to the point, no BS
@seabrin8 ай бұрын
Your 6-minute video made the bootcamp LMS content much easier to understand. Much appreciated!
@bernardcyrus818911 ай бұрын
Prayers answered! Most straight forward explanation I’ve seen!
@BinsiAgone Жыл бұрын
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.
@100rats23 жыл бұрын
Thanks for making it short and having nothing useless
@bk-entertainz7081 Жыл бұрын
You made this super simple to understand. Thank you.
@revanthk612 жыл бұрын
Impressed by your teaching skills.
@mustafaalsais7901 Жыл бұрын
You made it extremely easy to understand. Thank you man
@pavelkvasnicka6856 Жыл бұрын
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
@ivosesugh871 Жыл бұрын
Bro just out here saving lives and time. Thanks Bro
@aniedaniel37995 ай бұрын
Awesome! Incredibly clear, unlike my teacher :(
@theBATfamiliar6 күн бұрын
beautifully explained I really appreciate the turorial, thanks!
@jasontilford40683 ай бұрын
Great straight forward explanation. Thank you!
@liliacfury3 жыл бұрын
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 :)
@liliacfury3 жыл бұрын
@Milan Walker i’ve tried it. didn’t work.
@sujayirrinki49154 ай бұрын
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.
@charliebryant1987Ай бұрын
Thank you, can't wait to use this to start my own business
@eprice000 Жыл бұрын
Thank you! I enjoyed the explanation of inheritance in just a short video.
@albertoam2 Жыл бұрын
Thanks for this, it has been very easy to grasp the concept with your explanation
@jazielgarcia80578 ай бұрын
thanks for making it so easy to understand, awesome video, no more neither less information of what i needed
@snickered12 күн бұрын
thx brah... your Java series is legit
@lucreatiaalexander94767 ай бұрын
Thank you so much for this tutorial!! It was very comprehensive and helpful.
@joemariebisonaya6552 жыл бұрын
thank you for enlighten me.. its very useful in my study
@jason.fenstermakerАй бұрын
Liked and subscribed, great stuff man your content is very helpful
@abdulrenishr Жыл бұрын
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
@codemagic24872 жыл бұрын
thanks for the video! easy to understand and straight to point
@rayensboui268712 күн бұрын
Found it helpful.Thanks!
@juanestebanparraparra85312 жыл бұрын
Your tutorials are the best there are!
@rbsfinger5 ай бұрын
Great tutorial. Thanks!
@JuliHoffman2 жыл бұрын
You made that look easy! Thank you!!!
@vancelery34752 жыл бұрын
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.
@BroCodez2 жыл бұрын
you got it
@silasbrailey24453 ай бұрын
This was great. My professor is making it his life's work to make sure I dont understand inheritance.
@cokgulesimvar Жыл бұрын
omg! thank you for making it much more easier to understand.
@karlodinn54262 ай бұрын
Great Explanation as Always
@mattmjlg5053 Жыл бұрын
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
@kaushikkundu Жыл бұрын
Clean teaching... underrated channel bro
@YairRachmanyАй бұрын
Very awesome video
@play-cu5tv2 жыл бұрын
best tutorial I found Thank you!. You got a new Subscriber '
@abnews48976 ай бұрын
Tank you, very excellent explanation
@fitzsimmons74 ай бұрын
this was helpful, thank you bro
@joanferleymosqueralozano57603 жыл бұрын
Thanks bro! excellent video 🏁🏁
@danny.30363 жыл бұрын
Thanks, Bro! ☕ You're awesome!
@DanSaboia Жыл бұрын
Great video as always, keep the good work !!
@lokszeto6627 Жыл бұрын
Amazing teaching. Thx
@katiescape4 сағат бұрын
Amazing, ty.
@mechatroner-buildwhatevery438111 ай бұрын
Awesome lecture Bro, got my doubts cleared.
@josearivera63 Жыл бұрын
Thank, great presentation!
@romanrubanovich92733 жыл бұрын
Very good course, thank you
@ahmedmahmmued51135 ай бұрын
Great job! thx a lot
@atomiker356022 күн бұрын
W guy love u, you got a new sub :)
@BeeshoStudying2 жыл бұрын
thank you for the simple video
@harjotsingh98943 жыл бұрын
Amazing as always.
@honoredegg Жыл бұрын
Understood, inheritance, which both things have in common. 34th. Thank you, ma Bro Sensei!
@yasina632 жыл бұрын
Your teaching way is very good. Keep it up. Watching from Ethiopia
@arunnteam1901 Жыл бұрын
bro thank u best tutorial on thye internet
@christopherapuan9968 Жыл бұрын
I appreciate you! Thank you!
@hopmanlumpes85112 жыл бұрын
Thnx bro it helps me so gud
@AH-uo8vz Жыл бұрын
This helps so much. Thank you
@JesusSanchez-dv2ps3 жыл бұрын
Really helpful thanks!
@KaisarAnvar2 жыл бұрын
"Sit back, relax, and enjoy the show". Every time when I watch your video, I repeat that with you lol
@vegancrayon2 жыл бұрын
Thanks so much. this looks much easier now
@minhajuddin27057 ай бұрын
very good video helpful it is
@alanwarthon Жыл бұрын
Thanks it was very clear.
@dayhawka23902 жыл бұрын
Great class, Thanks
@user-wg5rd6rl11fgt Жыл бұрын
I love your videos . Can you make videos on Spring ,Spring boot, hibernate
@justinbanza47512 жыл бұрын
Thank you for that video......
@balanandrei6432 Жыл бұрын
Very useful tutorial!
@kemann38152 жыл бұрын
Thanks for another one 🙏
@jaru1911 Жыл бұрын
Liked Commented and subscribed
@marvinarias27989 ай бұрын
Cool work!
@kirillutsenko9306 Жыл бұрын
thx, great job
@Ansar3471 Жыл бұрын
Cool explanation!!!
@ahmadserhan30387 ай бұрын
Very easiy explaing thank you
@bubls. Жыл бұрын
Thank you for the great tutorial! One thing I am wondering about is how I would set the speed for each subclass.
@ankitharshe7003 Жыл бұрын
by making its constructor in parent class...& later on i would love to see ur speed
@Rosdell Жыл бұрын
Cool work...👍
@supernovic99 Жыл бұрын
Thank you bro!
@TharaMesseroux12 жыл бұрын
Thank you, Bro!
@sohailashraq-ek7gy Жыл бұрын
Great teaching 👏
@farxaankhaliif24652 ай бұрын
Thank you you helped me
@TheEvertonDias Жыл бұрын
Thanks, Bro!
@CSstudent_1001Ай бұрын
The best 👏👏👏👏
@minhtetpaing16953 жыл бұрын
Thank you so much sir.
@kainaatmakhani65503 жыл бұрын
marvellous job
@Foxekins2 жыл бұрын
I became a fellow bro :))))) Love ur vids!
@Jan-fw7qz2 жыл бұрын
That's really good
@lyubomyrsavchuk25272 жыл бұрын
what keyboard are you using? Sounds very satisfying
@nachoKrinkle Жыл бұрын
Thanks for this video
@rohitbharatbhandwalkar8583 Жыл бұрын
How can he explain such an overwhelming topic so easily??
@kathleenmccarthy63472 жыл бұрын
thanks this was very helpful
@blackhunter45676 ай бұрын
Love from India❤
@fantasy9960 Жыл бұрын
Thank you!
@Yo-hi2bx Жыл бұрын
Thanks! Would like to know about the idea of super()
@Diamond_Hanz3 жыл бұрын
Bro code keeps brings all the bros to the yard. thanks, bro!