#51 This and Super Method in Java

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

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

  • @meili7739
    @meili7739 Год назад +29

    You are the best Java teacher on RUclips. I subscribed to this channel and am learning one concept every day. You explain each concept in a very clear and concise but get to the point which helps me to learn quickly.

  • @LekhotlaMichaelLetsie
    @LekhotlaMichaelLetsie Год назад +48

    That John Cena reference was on another level.there is no way i am going to forget super method after that 😁

  • @deepthimr8555
    @deepthimr8555 11 месяцев назад +2

    i have seen multiple videos for constructors and you always be my favorite. the kind of ease in your teaching is amazing and the humor that you add in between help us remember the key points. Thank you so much sir

  • @Luffy_2804
    @Luffy_2804 Год назад +2

    9:04 best explanation
    was waiting for this concept
    QUALITY>>>QUANTITY

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

    i getting fall in love with this subject subject 😃😍

  • @divakarpareek9466
    @divakarpareek9466 Год назад +3

    This is the best explanation of so many scenarios with a crisp and clear explanation

  • @shantanukulkarni8883
    @shantanukulkarni8883 Год назад +27

    Thank you for introducing me to John Cena memes

  • @sruthigudmella3322
    @sruthigudmella3322 Год назад +5

    You are an amazing teacher but pls reorder the playlist!

  • @ijharmulani9712
    @ijharmulani9712 3 месяца назад +1

    What did I just watch, was it this simple the whole time , damn !!!, Awesome explaination

  • @neonyt6739
    @neonyt6739 11 дней назад

    the way he explain the concept of inheritane no one can explain it! i love to understand concept from him

  • @ajayghode3602
    @ajayghode3602 5 дней назад

    Thank you...Enjoyed!! This() will execute the constructor of the same class.super() will execute the super class

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

    What a way to teach and share knowledge ....!

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

    This is very well detailed and easy to understand. Thank You!

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

    Grateful to have found this channel, your way of explaining concepts is exactly what I've been looking for, keep up the good work Mr.Navin 👍

  • @tanujbhatt2184
    @tanujbhatt2184 Год назад +4

    11:58 , shouldn't super() for B be called twice?
    Once by the this()->B()->super() and then by B(int)->super() (As every constructor have super() by default)?
    Shouldn't the output be:
    in A (from super of B(int) )
    in A (from this() of B(int) to B() to super of B() )
    in B ( (from this() of B(int) to B() )
    in B int

    • @bothighlights4179
      @bothighlights4179 4 месяца назад +1

      When you type this() in a constructor the compiler doesn't insert super() by default! i hope it helped

  • @emremlck2905
    @emremlck2905 25 дней назад

    I haven't seen that kind of marvelous video thank you for everything

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

    Wow! Just liked super(n) I have never understood this before! Thank you🙏

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

    This is actually top-notch education, thank you for sharing so kindly your wisdom!

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

    Very enlightening video, congrats!

  • @krishnapatel-ys7nk
    @krishnapatel-ys7nk 10 месяцев назад +1

    Hi thanks for sharing such an amazing knowledge. But you need to reorder it ..this video should be after inheritance video...
    So plz reorder the playlist ...

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

    That's a deep explanation bro, thank you

  • @neonyt6739
    @neonyt6739 11 дней назад

    Greatest explanation sir.

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

    With your video you clearly teach inheritance concepts and the way u add some fuuny joke reference like john cena you can't see me so good to remind the things.

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

    Where we create main method so it have class which we save as a class name, it's main class or not

  • @jvuniverse7884
    @jvuniverse7884 Год назад +2

    Sir can you please provide the notes of this course?

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

    dang I wish these videos were out when I was learning java for the first time.

  • @HussainHumood-c4s
    @HussainHumood-c4s 9 месяцев назад

    Wow, terrific explanation!

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

    You are awesome :) , I am learning from your channel

  • @AkashChoudri-o7n
    @AkashChoudri-o7n 4 месяца назад

    I have one query! Instead of using this() is we can use the constructor chainning for this scenario??

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

    the joke in the first sentence made me crack up, good work sir!

  • @skadoosh9365
    @skadoosh9365 Год назад +4

    hey!! sir your content is good but i persinally faced problem in the order of the videos. can you just reorder it again?

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

    Now this was a good video, I liked it

  • @sivakumar-mt2cz
    @sivakumar-mt2cz Год назад +1

    Thank you for sharing..

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

    Great explanation

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

    These concepts using the "this()" method are called "CONSTRUCTER CHAINING".

  • @HappyTest-rr3jq
    @HappyTest-rr3jq Год назад +1

    great, but what if i only want to call the constructor of class B is there a way to disable that super method, obviously not removing the extends A

  • @MoeMoe-qr7od
    @MoeMoe-qr7od 11 месяцев назад

    excellent tutorial Sir.

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

    sir ,the order of videos is misplaced

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

    Thank you for the knowledge.

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

    Very nice explanation sir

  • @AbhilashMunnangi
    @AbhilashMunnangi 4 месяца назад +1

    jhon cena caught me off guard LMAO i can't stop laughing

  • @DevangPatel-b6u
    @DevangPatel-b6u 6 месяцев назад

    hey so does the objects constructor also call super() ?

  • @swastikasrivastava4708
    @swastikasrivastava4708 5 месяцев назад +1

    Hi sir, I have a doubt that when this() is used, why super() is not executed twice? As you have mentioned that all constructors by default will have super(); as the first line. It should be executed twice - 1st for parameterised constructor of B, the ln 2nd when this() calls the default constructor of B class.
    Also, thank you for making this playlist. It has helped me clear my java concepts in depth and not just definitions wise.

    • @bothighlights4179
      @bothighlights4179 4 месяца назад +3

      When you type this() in a constructor the compiler doesn't insert super() by default! i hope it helped

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

      @@bothighlights4179 thanks :)

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

    can we parameterize the "This method" so that it accesses first the default B constructor followed by the int B and then default A
    the output wile be like :
    in A
    in B int
    in B

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

    efficiently taught

  • @AyushKumar-bd7gq
    @AyushKumar-bd7gq 10 месяцев назад

    Sir, I have a doubt, is super only work on constructor ??

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

    John Cena ? 😂 You can't see it..damn this guy is so fun..!!! and the way he teaches with those expressions and thought processes of a student and then coming to the answer..is the best part of what he does.

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

      guessing obvious wrong answers first like a student and then coming to the points and correct principles..

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

    This () and Super() are being invoked in public B(int) to call all ? Doesn't work?

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

    Didnt expect someone saying John Cena during a inheritance lecture lmao

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

    Very Nyc sir.

  • @AashiSaxena-g8z
    @AashiSaxena-g8z 6 месяцев назад

    is class B not extending object class along with Class A?

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

    The John Cena metaphor... I'm studying for my final exam (tomorrow) and that John Cena metaphor just made me laugh in all these stress. Thanks Telusko!

  • @isultan.official
    @isultan.official 9 месяцев назад

    Explanation ❤

  • @Yashkumar-m05
    @Yashkumar-m05 3 месяца назад

    Superb

  • @nosystemissaf3
    @nosystemissaf3 Год назад +2

    reorder the playlist

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

      What should we see in this playlist before this video

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

      @@heisenberg213 bro. this playlist is available as a 12hr long video. see the time stamps in that videos description

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

    very nice explanation Navin I really like your way of teaching and explanation... I have a small doubt, is it possible to execute only child constructor without parent constructer execution like I need a output of "in B"? if yes how?

    • @mmahm4817
      @mmahm4817 7 месяцев назад +1

      Same question

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

    Very nice explanation. What if I don't want to call super class constructor?

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

      Without calling the constructor, how can u access parent class methods

  • @studychannel-xs5hu
    @studychannel-xs5hu 7 месяцев назад

    thanks sir

  • @RaviKumar-zb8bl
    @RaviKumar-zb8bl Год назад

    thanks

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

    Sir I think there is a mistake in this . Super() doesn't behave as john cena in the constructor, it's there inside the class directly outside the constructor while extends any other class. @Telusko please confirm.

  • @Batman_07-v2c
    @Batman_07-v2c 4 месяца назад

    11:57 output=> int A int
    int A
    int B
    int B int becz=>public B(int a)=>it will also have super() am i right? anyone can clarify my doubt

  • @VamsiNalam-d3r
    @VamsiNalam-d3r Год назад

    Tq Sir Very Nice

  • @TuxTuxedo-oc9kg
    @TuxTuxedo-oc9kg Год назад

    It is indeed fun haha! great videos!

  • @HishamMohammed-gh7eh
    @HishamMohammed-gh7eh Год назад

    Wow , amazing

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

    Thanks alot

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

    Your boring jokes are the best. 😂😂😂 Talking about John Cena memes 😂

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

    public class Main{
    public static void main(String[] args) {
    B obj = new B();//Object through constructor
    obj.Announcement();//Method call
    }
    }
    class A{//parent class

    public A(){
    //Constructor
    }
    public void Announcement(){
    System.out.println("In A.");
    }
    }
    class B extends A{//inheritance
    public B(){
    //Constructor
    }
    @Override //Changes method for B
    public void Announcement(){
    super.Announcement();//Call the parents method
    System.out.println("In B.");//Overriden method
    }
    }

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

    How is the Class A getting called without creating an object of A ?

    • @tototaro-y5g
      @tototaro-y5g 4 месяца назад

      Because we extended or inherited a class in b , so b class will have all the constructor of a as well and as we know constructor is called when object of its class have been created , so creating object for b , calling it's constructor as well it's super class which is a's constructor as well

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

    you're damn good

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

    class Parent {
    // public Parent() {}
    public Parent(int x) {
    System.out.println("Parent constructor called with x = " + x);
    }
    }
    class Child extends Parent {
    public Child() {
    System.out.println("Child default constructor called");
    }
    public Child(int y) {
    super(y + 1); // Calling the parent constructor with y + 1
    System.out.println("Child parameterized constructor called with y = " + y);
    }
    }
    class Main {
    public static void main(String[] args) {
    Child child1 = new Child(); // Implicit call to Parent's default constructor

    }
    } sir as here the parent class is not having the default constructor does that class wouldnt create its default .As this was giving an error. Can you please help me with this.

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

    i think inheritence is video number 48

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

    ❤❤❤❤

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

    john cena : u can't see me 🤣🤣

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

    helpful :D

  • @Yashkumar-m05
    @Yashkumar-m05 3 месяца назад

    Y

  • @msdivakar007
    @msdivakar007 Год назад +2

    John Cena is there and can't see

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

    hahaha the John Cena meme, that was funny

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

    i love you.

  • @sageheal-gt9ib
    @sageheal-gt9ib 9 месяцев назад

    are mughe chakkar aarhe hain

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

    May be its first comment

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

    Jhon Cena ❤😂

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

    2nd comment

  • @probirroy6874
    @probirroy6874 28 дней назад

    Do you ever do that?
    public class Hello
    {
    public static void main (String a[])
    {
    Swift s = new Swift("Fog Light");
    String d = "monday";
    String result = "";
    result = switch(d)
    {
    case "monday" -> "Week started";
    case "saturday","sunday" -> "Oh! its weekend.";
    default -> throw new IllegalArgumentException("Unexpected value: " + d);
    };
    System.out.println(result);
    }
    }
    class Car{
    public Car(){
    System.out.println("Constractor execute!");
    }
    public Car(int wheels){
    System.out.println("Car have wheels:" + wheels);
    }
    }
    class Swift extends Car{
    public Swift() {
    System.out.println("Swift is a car");
    }
    public Swift(String accessories) {
    System.out.println("New accessories include: " + accessories);
    this();
    }
    }
    Do you know what if I want to call this(); after System.out.println("New accessories include: " + accessories);?

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

    System.out.println("superbb teaching style! really interactive thankyou!");