Java inheritance 👪

Поділитися
Вставка

КОМЕНТАРІ • 364

  • @BroCodez
    @BroCodez  4 роки тому +164

    //***************************************
    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;
    }
    //***************************************

    • @matinmonshizadeh
      @matinmonshizadeh 3 роки тому +11

      Bro in Vehicle class you use 2 methods name go :) I think one of them is Stop

    • @patrickstar8585
      @patrickstar8585 2 роки тому +1

      you repeated the same method (& arguments) for the Vehicle class

  • @shyam.upadhyay
    @shyam.upadhyay 3 роки тому +596

    Bro inherited awesome teaching skills from parent class.

    • @urimsuh
      @urimsuh 2 роки тому +11

      *cough cough* no.

    • @hamzawarsi1834
      @hamzawarsi1834 2 роки тому +16

      @@urimsuh why

    • @tpkowastaken
      @tpkowastaken Рік тому

      lol

    • @marcoslightspeed5517
      @marcoslightspeed5517 Рік тому

      used 3 classes for a first example lol

    • @dodgevanniel01
      @dodgevanniel01 10 місяців тому +4

      @@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)

  • @BrandonMorrow-v4h
    @BrandonMorrow-v4h Рік тому +44

    You are hands down the best code teacher on UA-cam.

  • @hanac5586
    @hanac5586 3 роки тому +114

    Clear and straight to the point. Thank you

  • @cosecE
    @cosecE 3 роки тому +63

    you have no idea how better this video made me feel thank you so much college been really overwhelming so far

  • @satvikraval3571
    @satvikraval3571 Рік тому +6

    Thank you Bro. No confusion, straight to the point, no BS

  • @liliacfury
    @liliacfury 4 роки тому +16

    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 :)

    • @liliacfury
      @liliacfury 3 роки тому +2

      @Milan Walker i’ve tried it. didn’t work.

  • @kidshome6295
    @kidshome6295 4 місяці тому +2

    best teacher ever
    !!!!!!!!!!!!!!!!!!!! you made my life easy God bless you and your beloved ones for ever !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  • @BinsiAgone
    @BinsiAgone 2 роки тому +1

    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.

  • @bernardcyrus8189
    @bernardcyrus8189 Рік тому +1

    Prayers answered! Most straight forward explanation I’ve seen!

  • @pavelkvasnicka6856
    @pavelkvasnicka6856 Рік тому +3

    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

  • @gusocha3852
    @gusocha3852 2 місяці тому +1

    Super awesome Java tutorial! 👍🏼 I learn a lot from here!

  • @karlodinn5426
    @karlodinn5426 10 місяців тому +2

    Great Explanation as Always

  • @silasbrailey2445
    @silasbrailey2445 11 місяців тому +2

    This was great. My professor is making it his life's work to make sure I dont understand inheritance.

  • @seabrin
    @seabrin Рік тому

    Your 6-minute video made the bootcamp LMS content much easier to understand. Much appreciated!

  • @YonatanHaile-rf2jm
    @YonatanHaile-rf2jm 3 місяці тому +1

    Simple yet an amazing explanation

  • @MuhammadHazimbinAzahan
    @MuhammadHazimbinAzahan 3 місяці тому +1

    thanks bro, got an assignment due in one week, thanks for the help my guy

    • @haziqwhz
      @haziqwhz 3 місяці тому

      stop lying bro im your classmate

  • @100rats2
    @100rats2 3 роки тому +6

    Thanks for making it short and having nothing useless

  • @bk-entertainz7081
    @bk-entertainz7081 2 роки тому +2

    You made this super simple to understand. Thank you.

  • @professionalaveragekid
    @professionalaveragekid 7 місяців тому

    probably one of the most comprehensive java tutorials, without cutting corners :D

  • @theBATfamiliar
    @theBATfamiliar 8 місяців тому +2

    beautifully explained I really appreciate the turorial, thanks!

  • @ivosesugh871
    @ivosesugh871 2 роки тому

    Bro just out here saving lives and time. Thanks Bro

  • @anaszagha3823
    @anaszagha3823 Місяць тому +1

    Nice !!

  • @abhisheksinhgohil8463
    @abhisheksinhgohil8463 Рік тому +1

    Great Class

  • @play-cu5tv
    @play-cu5tv 3 роки тому +1

    best tutorial I found Thank you!. You got a new Subscriber
    '

  • @nefhrit
    @nefhrit Місяць тому +1

    I love you man, I learn 99% from you and 1% from school

  • @YairRachmany
    @YairRachmany 9 місяців тому +2

    Very awesome video

  • @jazielgarcia8057
    @jazielgarcia8057 Рік тому

    thanks for making it so easy to understand, awesome video, no more neither less information of what i needed

  • @vancelery3475
    @vancelery3475 2 роки тому +12

    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.

  • @juanestebanparraparra8531
    @juanestebanparraparra8531 2 роки тому

    Your tutorials are the best there are!

  • @mustafaalsais7901
    @mustafaalsais7901 2 роки тому +1

    You made it extremely easy to understand. Thank you man

  • @dianamilenaarchilacordoba4632
    @dianamilenaarchilacordoba4632 4 місяці тому

    great video!!! I'm infinitely grateful for your dedication and big heart to share this knowledge with the world. Thank you soo much

  • @jason.fenstermaker
    @jason.fenstermaker 9 місяців тому

    Liked and subscribed, great stuff man your content is very helpful

  • @abdulrenishr
    @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

  • @jaywest1593
    @jaywest1593 7 місяців тому

    Good video. Thanks for the applied example

  • @SnothiSmelane
    @SnothiSmelane 5 місяців тому

    You probably the best teacher 🔥

  • @kaushikkundu
    @kaushikkundu 2 роки тому

    Clean teaching... underrated channel bro

  • @aniedaniel3799
    @aniedaniel3799 Рік тому +1

    Awesome! Incredibly clear, unlike my teacher :(

  • @charliebryant1987
    @charliebryant1987 9 місяців тому

    Thank you, can't wait to use this to start my own business

  • @Rosdell
    @Rosdell 2 роки тому

    Cool work...👍

  • @mattmjlg5053
    @mattmjlg5053 2 роки тому +1

    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

  • @DanSaboia
    @DanSaboia Рік тому

    Great video as always, keep the good work !!

  • @snickered
    @snickered 8 місяців тому

    thx brah... your Java series is legit

  • @revanthk61
    @revanthk61 3 роки тому

    Impressed by your teaching skills.

  • @lucreatiaalexander9476
    @lucreatiaalexander9476 Рік тому

    Thank you so much for this tutorial!! It was very comprehensive and helpful.

  • @yasina63
    @yasina63 2 роки тому

    Your teaching way is very good. Keep it up. Watching from Ethiopia

  • @jasontilford4068
    @jasontilford4068 11 місяців тому

    Great straight forward explanation. Thank you!

  • @albertoam2
    @albertoam2 Рік тому

    Thanks for this, it has been very easy to grasp the concept with your explanation

  • @CSstudent_1001
    @CSstudent_1001 10 місяців тому

    The best 👏👏👏👏

  • @jaru1911
    @jaru1911 2 роки тому

    Liked Commented and subscribed

  • @sohailashraq-ek7gy
    @sohailashraq-ek7gy Рік тому

    Great teaching 👏

  • @eprice000
    @eprice000 2 роки тому

    Thank you! I enjoyed the explanation of inheritance in just a short video.

  • @atomiker3560
    @atomiker3560 9 місяців тому

    W guy love u, you got a new sub :)

  • @patriotkz2308
    @patriotkz2308 4 місяці тому

    Clear and informative. Thanks!

  • @sujayirrinki4915
    @sujayirrinki4915 Рік тому

    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.

  • @arunnteam1901
    @arunnteam1901 2 роки тому

    bro thank u best tutorial on thye internet

  • @CodeBytes_Official
    @CodeBytes_Official 6 місяців тому

    teaching was straight to the point bro code!

  • @lokszeto6627
    @lokszeto6627 2 роки тому

    Amazing teaching. Thx

  • @danny.3036
    @danny.3036 3 роки тому +2

    Thanks, Bro! ☕ You're awesome!

  • @mechatroner-buildwhatevery4381

    Awesome lecture Bro, got my doubts cleared.

  • @Foxekins
    @Foxekins 3 роки тому

    I became a fellow bro :))))) Love ur vids!

  • @KaisarAnvar
    @KaisarAnvar 3 роки тому

    "Sit back, relax, and enjoy the show". Every time when I watch your video, I repeat that with you lol

  • @joemariebisonaya655
    @joemariebisonaya655 3 роки тому

    thank you for enlighten me.. its very useful in my study

  • @abnews4897
    @abnews4897 Рік тому

    Tank you, very excellent explanation

  • @cokgulesimvar
    @cokgulesimvar 2 роки тому

    omg! thank you for making it much more easier to understand.

  • @Ansar3471
    @Ansar3471 2 роки тому

    Cool explanation!!!

  • @IykosWhite
    @IykosWhite 7 місяців тому

    Very Injecting concept video

  • @kainaatmakhani6550
    @kainaatmakhani6550 3 роки тому

    marvellous job

  • @PetBuddies
    @PetBuddies 3 роки тому

    Awesome!!!!!!!!!!!!

  • @minhajuddin2705
    @minhajuddin2705 Рік тому

    very good video
    helpful it is

  • @ahmadserhan3038
    @ahmadserhan3038 Рік тому

    Very easiy explaing thank you

  • @rbsfinger
    @rbsfinger Рік тому

    Great tutorial. Thanks!

  • @josearivera63
    @josearivera63 2 роки тому

    Thank, great presentation!

  • @quanyufeng579
    @quanyufeng579 3 роки тому

    Fantastic video

  • @justinbanza4751
    @justinbanza4751 3 роки тому

    Thank you for that video......

  • @nachoKrinkle
    @nachoKrinkle 2 роки тому

    Thanks for this video

  • @BeeshoStudying
    @BeeshoStudying 3 роки тому

    thank you for the simple video

  • @joanferleymosqueralozano5760
    @joanferleymosqueralozano5760 3 роки тому

    Thanks bro! excellent video 🏁🏁

  • @codemagic2487
    @codemagic2487 3 роки тому

    thanks for the video! easy to understand and straight to point

  • @solomonwise8126
    @solomonwise8126 2 місяці тому

    Love from Kenya... manze unatuokolea

  • @userkanchank
    @userkanchank Рік тому

    I love your videos .
    Can you make videos on Spring ,Spring boot, hibernate

  • @balanandrei6432
    @balanandrei6432 2 роки тому

    Very useful tutorial!

  • @adityaalshi7081
    @adityaalshi7081 3 роки тому

    great video

  • @JuliHoffman
    @JuliHoffman 2 роки тому

    You made that look easy! Thank you!!!

  • @nimaamini8060
    @nimaamini8060 4 роки тому

    I love you and your channel 💙

  • @dayhawka2390
    @dayhawka2390 2 роки тому

    Great class, Thanks

  • @holygraphite1292
    @holygraphite1292 2 роки тому

    Great.

  • @marvinarias2798
    @marvinarias2798 Рік тому

    Cool work!

  • @fitzsimmons7
    @fitzsimmons7 Рік тому

    this was helpful, thank you bro

  • @blackhunter4567
    @blackhunter4567 Рік тому

    Love from India❤

  • @eugenezuev7349
    @eugenezuev7349 9 місяців тому

    splendid

  • @rayensboui2687
    @rayensboui2687 8 місяців тому

    Found it helpful.Thanks!

  • @harjotsingh9894
    @harjotsingh9894 3 роки тому

    Amazing as always.

  • @bunyodbekho
    @bunyodbekho 2 роки тому

    I feel earthquake while you're typing, lol
    Thank you for the video, it really helped!

  • @Rohithgowda-q3d
    @Rohithgowda-q3d 3 місяці тому

    good go!!

  • @alanwarthon
    @alanwarthon Рік тому

    Thanks it was very clear.

  • @bubls.
    @bubls. 2 роки тому +2

    Thank you for the great tutorial!
    One thing I am wondering about is how I would set the speed for each subclass.

    • @ankitharshe7003
      @ankitharshe7003 2 роки тому

      by making its constructor in parent class...& later on i would love to see ur speed

  • @hopmanlumpes8511
    @hopmanlumpes8511 2 роки тому

    Thnx bro it helps me so gud

  • @shalajko
    @shalajko 4 роки тому +1

    good, good...

  • @Jan-fw7qz
    @Jan-fw7qz 3 роки тому

    That's really good