Java super keyword 🦸‍♂️

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

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

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

    //********************************************
    public class Main {
    public static void main(String[] args) {

    // super = keyword refers to the superclass (parent) of an object
    // very similar to the "this" keyword

    Hero hero1 = new Hero("Batman",42,"$$$");
    Hero hero2 = new Hero("Superman",43,"everything");

    System.out.println(hero2.toString());

    }
    }
    //********************************************
    public class Person {
    String name;
    int age;

    Person(String name,int age){
    this.name = name;
    this.age = age;
    }

    public String toString() {
    return this.name + "
    " + this.age + "
    ";
    }

    }//********************************************
    public class Hero extends Person{
    String power;

    Hero(String name,int age,String power){
    super(name,age);
    this.power = power;
    }

    public String toString() {
    return super.toString()+this.power;
    }
    }//********************************************

    • @Kingdd1os
      @Kingdd1os 2 года назад +3

      Bro, you helped me so much that i canot say in words how thankful iam , God bless you.

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

      @@Kingdd1os hm...

  • @baubaudinamo
    @baubaudinamo 4 года назад +135

    this was Super() easy to understand

  • @reynaldojrcapilitan943
    @reynaldojrcapilitan943 3 года назад +35

    More power to you man.
    I watched a lot of tutorials but yours really exceeded everyone.
    The way you explain is so easy to understand!

  • @furiouspuzza7080
    @furiouspuzza7080 4 года назад +24

    I'm surprised that this channel only has 2.53k subs, it's "super" underrated

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

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

  • @EmirKaanOgsarim
    @EmirKaanOgsarim 11 месяцев назад +4

    I just love how you repeat previous topics by explaining the code in a certain order. Thx bro, greetings from Turkey

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

  • @husein_alfil
    @husein_alfil 3 года назад +15

    This is the best RUclips Channel for teaching how to Code on RUclips !
    Keep going and you will surely reach the 1 Million soon !
    Thank you for the great way in explaining !

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

    One of the best youtube channel helps me a lot in learning coding.

  • @thang.d2382
    @thang.d2382 3 года назад +2

    Your video is short, but it's informative. That's all we need. Many thanks

  • @firepower01
    @firepower01 2 года назад +7

    Your videos are getting me through university dude. Thank you so much for making these tutorials.

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

    The best channel to learn and get started with a new programming language . Thanks bro

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

    this actually deserves more likes unfortunately people dont do this often :(

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

    You show very good examples and explain it very well!

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

    Awesome video. I'm new to programming and learning JAVA atm. Would surely enroll in one of your courses if you had them because all the subjects i struggle with in my textbook are always clear to me after one of your video's!

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

    thank you
    after 4 hour long lesson in school, you made it clearer in 3 videos of -10 min
    thank you

  • @Khadheeja
    @Khadheeja 6 месяцев назад +1

    Awesome Stuff

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

    Best java course I've found, by far

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

    it is very clear explanation

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

    great stuff!! I've gone through a year and a half in college, we never had Java, but after I switched to another college (years later), they're having Java there and it's been a pain because of the virtual environment.
    maybe my plugin in the IDE can't handle saving the file multiple times to adjust something because it always tells me it couldn't delete one of the temp files, and in the terminal it works the way it did before the alterations I've done so it's like I'm running the older version of that file.
    then I restart the computer to make the temp files forcibly get removed whenever I can't build the project and it works, all of the alterations are applied.

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

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

  • @tekengaged2230
    @tekengaged2230 4 месяца назад

    Excellent Video!!!

  • @denizorhan1470
    @denizorhan1470 4 месяца назад

    Thank you bro. Videos are amazingly well ordered an educative

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

    you are really a java server i have understood more than i ever imagined

  • @derjenicheoffiziell
    @derjenicheoffiziell 4 года назад +4

    Hey Bro, I just shared your channel on r/learnprogramming, hopefully it'll help you in your heroic defiance of the almighty algorithm :)

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

      Taylo you are AWESOME. I appreciate the share. I hate to admit it, but I could use all the help I can get. thanks again.

    • @derjenicheoffiziell
      @derjenicheoffiziell 4 года назад

      @@BroCodez No problem man, you definitely deserve more exposure

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

    Cool lesson. Thanks.

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

    We got lots of tech channel of Indian Teachers, but your teaching method is on point Thanks for creating all this stuff Bro

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

    superb vid. very powerful presentation

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

    brooooo, thank you so much for this tutorial. only after seeing this did I understand how to properly use the keywords - super and this.

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

    Amazing😀😀😀

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

    Super duper

  • @lanak.6886
    @lanak.6886 2 года назад +1

    these 10 min thought me more than the 2 hour lecture in university lol thx bro

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

    Thank you, finally I understand what is super keyword for!

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

    thanks for the video

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

    Great Lecture

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

    HEYY BROS This guy is great Greetings from Bern

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

    Really helpful content👍🏻

  • @JackNonsence
    @JackNonsence 8 месяцев назад +1

    Bro is much better than my professor.

  • @JashanSingh-ve7yx
    @JashanSingh-ve7yx 3 года назад

    Good

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

    Well explained, Thanks a lot

  • @DrinkableWater
    @DrinkableWater 4 года назад +2

    Finally i know what super is doing :D thanks

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

      Yeah all it does is refer to an object's super class

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

    amazing

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

    Awesome

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

    Getting lessons from gigachad. Bruv this is bussin

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

    great

  • @praveenbalajikalla-ng6mx
    @praveenbalajikalla-ng6mx 7 месяцев назад

    woww

  • @orlandohunter2785
    @orlandohunter2785 3 года назад +3

    The prayers did worked, the algorithm brought me here. :)

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

    really enjoying your tutorial

  • @balaeinstein8710
    @balaeinstein8710 4 года назад +1

    super cool videos bro. thanks . when will the playlist be updated bro? . It is difficult to search the videos bro

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

      I'm currently updating the videos now, I have the new videos unlisted and will release them in a batch weekly

    • @balaeinstein8710
      @balaeinstein8710 4 года назад

      @@BroCodez thanks bro. hope this channel reaches good number of subscribers soon

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

    Thanks for the example, very clear.

  • @gedasred1
    @gedasred1 3 года назад +4

    Hey Bro, what is more acceptable to use: System.out.println(hero2) or System.out.println(hero2.toString())? Since both prints the same output.

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

      just put hero2, i use intellij and it says that it's a redundant string call and it's useless, toString means to convert the memory value/data into a readable string, which was already done in the other classes

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

    Besttttt

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

    elegant simple and awesome! thank you!

  • @DeepakKumar-dw1re
    @DeepakKumar-dw1re 2 года назад

    Super

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

    Best❤

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

    Thank you for this

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

    Great! 👍

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

    NIce.

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

    Amazing

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

    Super basically equals Parent. Good to know!

  • @noisyguest5249
    @noisyguest5249 4 года назад +3

    I never knew "super" keyword even existed

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

    Thank you Bro you’re always be our super()hero💪😆

  • @MrNb-xu7jl
    @MrNb-xu7jl Год назад

    yeeeehhhh finnaly i understood what it meansssss. bro you are the bestttt

  • @maelscott
    @maelscott 9 дней назад

    Becoming a hero

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

    Is the toString method in Hero considered an Overriding method? Since it's using the original method from its super class so I'm not sure.

  • @avi-ish8669
    @avi-ish8669 8 месяцев назад

    super

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

    Best, as always :)

  • @jojovstojo
    @jojovstojo Год назад +1

    Superman is your favorite hero right?? Yeah I find BAtman lame too ! Thats why you printed 'hero2' attributes when you also had 'hero1' ! 😉😄 NIce turorial bdw..... So far loving the simplicity of videos.

  • @曾毓哲-b1t
    @曾毓哲-b1t Год назад

    Thank you very much

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

    You're the best

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

    thankyou sir

  • @Jason-lu5wr
    @Jason-lu5wr Год назад

    When the class is an extension of the parent class, if an object is instantiated within the child class does that mean the variables/objects that were extended are separate from the variables/objects of the original parent class? (Sorry if that was worded poorly as I'm still new to this)

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

    Thank you Bro!!!!!!!!!!!!!!!!!!!

  • @alexandre39494
    @alexandre39494 Год назад +1

    Hello Bro Code , in your video I see a lot of samples in "package explorer".
    From were do you get these samples?
    I would like to get these samples too.
    any help would be very nice.

  • @ברבר-ס2ב
    @ברבר-ס2ב Год назад

    KING

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

    Hey bro a simple question, why extend a class to use its functionality when we can simply make its object and do the same?

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

    Dude i love you so much.

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

    Thanks bro

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

    Thanks Bro

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

    Thanks, Bro! ☕ You're awesome!

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

    YOU ARE A LEGEND!!

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

    your geniuse

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

    naisuu

  • @Sofia-rg3er
    @Sofia-rg3er 7 месяцев назад

    Thank you bro

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

    I have a question related to overriding of the toString method in Hero class, is it necessary?

  • @MrLoser-ks2xn
    @MrLoser-ks2xn 2 года назад

    Thanks

  • @whyjamesisacommonname
    @whyjamesisacommonname Год назад +1

    If we use this:
    Hero hero1 = new Hero(Person,44,"44");
    'Person' I'm referring to the parent class.
    What would be the constructor for Hero?

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

    Frankys reaction after this video: "suuuuupeeer()";

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

    explained it better than my prof

  • @Ahmad-jc7by
    @Ahmad-jc7by Год назад

    ❤❤❤

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

    What would happen if I would only run: sout(hero2); AT 07:00 ? Why would it not just print out the 3 Values too? Why is the super-statement needed?

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

      Is it because we cannot make objects on superclasses in java, so the hero-class has to extend the "toString" methode of the person-class? would that be called overriding?

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

    Thank you so much sir.

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

    Thanks a lot

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

    Commenting here for the reach

  • @johan-oe9kz
    @johan-oe9kz 2 года назад

    👍

  • @noisyguest5249
    @noisyguest5249 4 года назад +2

    U should try unity game engine

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

      I would like to, but I have my hands full right now lol

  • @nerrixj.l.6102
    @nerrixj.l.6102 2 года назад

    😍

  • @王继寒
    @王继寒 2 года назад

    thanks

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

    Hello Bro Code, in your video I can see a lot of samples in "Package Explorer" ,from were did you get these samples?
    I would like to get these samples too.
    can you give me these samples or give me the internet link to these samples?
    any help would be very appreciated

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

    THANK YOU