Java super keyword 🦸‍♂️

Поділитися
Вставка
  • Опубліковано 17 січ 2025

КОМЕНТАРІ • 213

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

    //********************************************
    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 роки тому +153

    this was Super() easy to understand

  • @reynaldojrcapilitan943
    @reynaldojrcapilitan943 3 роки тому +36

    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 роки тому +28

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

  • @EmirKaanOgsarim
    @EmirKaanOgsarim Рік тому +4

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

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

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

  • @husein_alfil
    @husein_alfil 3 роки тому +15

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

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

  • @OrinOn127
    @OrinOn127 20 днів тому

    well explaination

  • @Khadheeja
    @Khadheeja 9 місяців тому +1

    Awesome Stuff

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

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

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

    superb vid. very powerful presentation

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

    Amazing😀😀😀

  • @thang.d2382
    @thang.d2382 3 роки тому +2

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

  • @TheSkippy82
    @TheSkippy82 29 днів тому

    you are single handedly getting my through my java course ty

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

    Great Lecture

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

    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 11 місяців тому

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

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

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

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

    it is very clear explanation

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

    You show very good examples and explain it very well!

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

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

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

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

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

    Really helpful content👍🏻

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

    Best❤

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

    really enjoying your tutorial

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

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

    thanks for the video

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

    Super duper

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

    amazing

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

    Awesome

  • @DeepakKumar-dw1re
    @DeepakKumar-dw1re 3 роки тому

    Super

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

    Excellent Video!!!

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

    great

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

    Amazing

  • @JashanSingh-ve7yx
    @JashanSingh-ve7yx 3 роки тому

    Good

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

    Besttttt

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

    NIce.

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

    Best java course I've found, by far

  • @praveenbalajikalla-ng6mx
    @praveenbalajikalla-ng6mx 10 місяців тому

    woww

  • @avi-ish8669
    @avi-ish8669 11 місяців тому

    super

  • @lanak.6886
    @lanak.6886 2 роки тому +1

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

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

    Cool lesson. Thanks.

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

    Because of you good sir! I was having fun with my programming exam

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

    Becoming a hero

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

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

    Great! 👍

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

    Thank you for this

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

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

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

    thankyou sir

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

    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

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

  • @Ahmad-jc7by
    @Ahmad-jc7by Рік тому

    ❤❤❤

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

    naisuu

  • @firepower01
    @firepower01 3 роки тому +7

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

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

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

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

    HEYY BROS This guy is great Greetings from Bern

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

    your geniuse

  • @ברבר-ס2ב
    @ברבר-ס2ב Рік тому

    KING

  • @曾毓哲-b1t
    @曾毓哲-b1t Рік тому

    Thank you very much

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

  • @MrBensella
    @MrBensella 3 роки тому +1

    elegant simple and awesome! thank you!

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

    Commenting here for the reach

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

    Thanks bro

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

    You're the best

  • @jojovstojo
    @jojovstojo 2 роки тому +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.

  • @MrLoser-ks2xn
    @MrLoser-ks2xn 2 роки тому

    Thanks

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

    Thanks Bro

  • @noisyguest5249
    @noisyguest5249 4 роки тому +3

    I never knew "super" keyword even existed

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

  • @johan-oe9kz
    @johan-oe9kz 3 роки тому

    👍

  • @MrNb-xu7jl
    @MrNb-xu7jl 2 роки тому

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

  • @Sofia-rg3er
    @Sofia-rg3er 10 місяців тому

    Thank you bro

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

    Thanks for the example, very clear.

  • @nerrixj.l.6102
    @nerrixj.l.6102 2 роки тому

    😍

  • @王继寒
    @王继寒 2 роки тому

    thanks

  • @gedasred1
    @gedasred1 4 роки тому +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

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

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

  • @orlandohunter2785
    @orlandohunter2785 3 роки тому +3

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

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

    Getting lessons from gigachad. Bruv this is bussin

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

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

  • @GOODBOY-vt1cf
    @GOODBOY-vt1cf 3 роки тому +1

    4:28

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

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

    ♥️

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

    THANK YOU

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

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

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

    Thank you so much sir.

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

    Thanks a lot

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

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

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

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

    Hello bro
    I'm the 444.444 subscriber for your super channel, hope you say hi to your new bro🤣

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

    explained it better than my prof

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

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

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

    Thanks, Bro! ☕ You're awesome!

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

    1:48 I saw that coming

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

    Super basically equals Parent. Good to know!

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

    thaaaaaaaaaaaank you 💕💕💕.