Java inheritance 👪

Поделиться
HTML-код
  • Опубликовано: 27 ноя 2024

Комментарии • 354

  • @BroCodez
    @BroCodez  4 года назад +152

    //***************************************
    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 года назад +564

    Bro inherited awesome teaching skills from parent class.

    • @urimsuh
      @urimsuh 2 года назад +11

      *cough cough* no.

    • @hamzawarsi1834
      @hamzawarsi1834 2 года назад +15

      @@urimsuh why

    • @tpkowastaken
      @tpkowastaken Год назад

      lol

    • @marcoslightspeed5517
      @marcoslightspeed5517 Год назад

      used 3 classes for a first example lol

    • @dodgevanniel01
      @dodgevanniel01 8 месяцев назад +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 9 месяцев назад +38

    You are hands down the best code teacher on RUclips.

  • @hanac5586
    @hanac5586 3 года назад +111

    Clear and straight to the point. Thank you

  • @cosecE
    @cosecE 3 года назад +61

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

  • @kidshome6295
    @kidshome6295 2 месяца назад +2

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

  • @satvikraval3571
    @satvikraval3571 Год назад +6

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

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

  • @seabrin
    @seabrin Год назад

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

  • @professionalaveragekid
    @professionalaveragekid 5 месяцев назад

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

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

  • @karlodinn5426
    @karlodinn5426 8 месяцев назад +2

    Great Explanation as Always

  • @silasbrailey2445
    @silasbrailey2445 9 месяцев назад +1

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

  • @liliacfury
    @liliacfury 3 года назад +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.

  • @100rats2
    @100rats2 3 года назад +6

    Thanks for making it short and having nothing useless

  • @gusocha3852
    @gusocha3852 19 часов назад

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

  • @YonatanHaile-rf2jm
    @YonatanHaile-rf2jm Месяц назад

    Simple yet an amazing explanation

  • @bk-entertainz7081
    @bk-entertainz7081 2 года назад +2

    You made this super simple to understand. Thank you.

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

  • @theBATfamiliar
    @theBATfamiliar 6 месяцев назад +2

    beautifully explained I really appreciate the turorial, thanks!

  • @revanthk61
    @revanthk61 3 года назад

    Impressed by your teaching skills.

  • @jaywest1593
    @jaywest1593 5 месяцев назад

    Good video. Thanks for the applied example

  • @YairRachmany
    @YairRachmany 7 месяцев назад +2

    Very awesome video

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

  • @ivosesugh871
    @ivosesugh871 Год назад

    Bro just out here saving lives and time. Thanks Bro

  • @mustafaalsais7901
    @mustafaalsais7901 2 года назад +1

    You made it extremely easy to understand. Thank you man

  • @juanestebanparraparra8531
    @juanestebanparraparra8531 2 года назад

    Your tutorials are the best there are!

  • @charliebryant1987
    @charliebryant1987 7 месяцев назад

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

  • @jazielgarcia8057
    @jazielgarcia8057 Год назад

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

  • @sujayirrinki4915
    @sujayirrinki4915 10 месяцев назад

    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.

  • @MuhammadHazimbinAzahan
    @MuhammadHazimbinAzahan Месяц назад +1

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

    • @haziqwhz
      @haziqwhz Месяц назад

      stop lying bro im your classmate

  • @ahmadserhan3038
    @ahmadserhan3038 Год назад

    Very easiy explaing thank you

  • @kaushikkundu
    @kaushikkundu Год назад

    Clean teaching... underrated channel bro

  • @solomonwise8126
    @solomonwise8126 2 дня назад

    Love from Kenya... manze unatuokolea

  • @joemariebisonaya655
    @joemariebisonaya655 3 года назад

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

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

  • @dianamilenaarchilacordoba4632
    @dianamilenaarchilacordoba4632 2 месяца назад

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

  • @SnothiSmelane
    @SnothiSmelane 3 месяца назад

    You probably the best teacher 🔥

  • @albertoam2
    @albertoam2 Год назад

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

  • @lucreatiaalexander9476
    @lucreatiaalexander9476 Год назад

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

  • @KaisarAnvar
    @KaisarAnvar 2 года назад

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

  • @BeeshoStudying
    @BeeshoStudying 2 года назад

    thank you for the simple video

  • @sohailashraq-ek7gy
    @sohailashraq-ek7gy Год назад

    Great teaching 👏

  • @jaru1911
    @jaru1911 2 года назад

    Liked Commented and subscribed

  • @aniedaniel3799
    @aniedaniel3799 11 месяцев назад +1

    Awesome! Incredibly clear, unlike my teacher :(

  • @lokszeto6627
    @lokszeto6627 2 года назад

    Amazing teaching. Thx

  • @minhajuddin2705
    @minhajuddin2705 Год назад

    very good video
    helpful it is

  • @IykosWhite
    @IykosWhite 5 месяцев назад

    Very Injecting concept video

  • @jasontilford4068
    @jasontilford4068 9 месяцев назад

    Great straight forward explanation. Thank you!

  • @Rosdell
    @Rosdell 2 года назад

    Cool work...👍

  • @patriotkz2308
    @patriotkz2308 Месяц назад

    Clear and informative. Thanks!

  • @nachoKrinkle
    @nachoKrinkle 2 года назад

    Thanks for this video

  • @eprice000
    @eprice000 2 года назад

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

  • @abnews4897
    @abnews4897 Год назад

    Tank you, very excellent explanation

  • @DanSaboia
    @DanSaboia Год назад

    Great video as always, keep the good work !!

  • @CSstudent_1001
    @CSstudent_1001 8 месяцев назад

    The best 👏👏👏👏

  • @kainaatmakhani6550
    @kainaatmakhani6550 3 года назад

    marvellous job

  • @CodeBytes_Official
    @CodeBytes_Official 3 месяца назад

    teaching was straight to the point bro code!

  • @justinbanza4751
    @justinbanza4751 3 года назад

    Thank you for that video......

  • @yasina63
    @yasina63 2 года назад

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

  • @snickered
    @snickered 6 месяцев назад

    thx brah... your Java series is legit

  • @arunnteam1901
    @arunnteam1901 2 года назад

    bro thank u best tutorial on thye internet

  • @adityaalshi7081
    @adityaalshi7081 2 года назад

    great video

  • @cokgulesimvar
    @cokgulesimvar 2 года назад

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

  • @quanyufeng579
    @quanyufeng579 3 года назад

    Fantastic video

  • @Ansar3471
    @Ansar3471 2 года назад

    Cool explanation!!!

  • @honoredegg
    @honoredegg 2 года назад

    Understood, inheritance, which both things have in common. 34th. Thank you, ma Bro Sensei!

  • @nagazarihun-pz1dz
    @nagazarihun-pz1dz 4 месяца назад

    I am very Usefull

  • @play-cu5tv
    @play-cu5tv 2 года назад +1

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

  • @abhisheksinhgohil8463
    @abhisheksinhgohil8463 Год назад

    Great Class

  • @holygraphite1292
    @holygraphite1292 2 года назад

    Great.

  • @dayhawka2390
    @dayhawka2390 2 года назад

    Great class, Thanks

  • @jason.fenstermaker
    @jason.fenstermaker 7 месяцев назад

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

  • @Jan-fw7qz
    @Jan-fw7qz 3 года назад

    That's really good

  • @eugenezuev7349
    @eugenezuev7349 7 месяцев назад

    splendid

  • @balanandrei6432
    @balanandrei6432 Год назад

    Very useful tutorial!

  • @josearivera63
    @josearivera63 2 года назад

    Thank, great presentation!

  • @奶茶漢化
    @奶茶漢化 2 года назад

    I won’t skip any advertisement in order to support u

  • @rbsfinger
    @rbsfinger 11 месяцев назад

    Great tutorial. Thanks!

  • @mechatroner-buildwhatevery4381

    Awesome lecture Bro, got my doubts cleared.

  • @AbduqodirOdiljonov-o4x
    @AbduqodirOdiljonov-o4x 8 месяцев назад

    Great

  • @PetBuddies
    @PetBuddies 3 года назад

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

  • @Rohithgowda-q3d
    @Rohithgowda-q3d Месяц назад

    good go!!

  • @shalajko
    @shalajko 3 года назад +1

    good, good...

  • @danny.3036
    @danny.3036 3 года назад +2

    Thanks, Bro! ☕ You're awesome!

  • @marvinarias2798
    @marvinarias2798 Год назад

    Cool work!

  • @huuloc8719
    @huuloc8719 3 года назад

    Nice.

  • @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 Год назад

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

  • @romario92730
    @romario92730 3 года назад

    Very good course, thank you

  • @lightrezevr
    @lightrezevr Месяц назад

    Good luck bro

  • @gh051guy7
    @gh051guy7 2 года назад

    SUPER HELPFUll

  • @alanwarthon
    @alanwarthon Год назад

    Thanks it was very clear.

  • @franklinkaranja7446
    @franklinkaranja7446 2 года назад

    nicely done

  • @dawitpetros7062
    @dawitpetros7062 3 года назад

    IT IS HELPFULL

  • @savagedesuyoooooo2182
    @savagedesuyoooooo2182 Год назад

    good stuff

  • @ajdndbdjbdj
    @ajdndbdjbdj 2 года назад

    Nice my bro

  • @siavashdarvishi855
    @siavashdarvishi855 Год назад

    heeey bro, i have exam tomorrow and guess what?! you are my savior

  • @robot8815
    @robot8815 Год назад

    keep going

  • @bunyodbekho
    @bunyodbekho 2 года назад

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