#51 This and Super Method in Java

Поделиться
HTML-код
  • Опубликовано: 12 июл 2024
  • Check out our courses:
    Spring and Microservices Weekend Live Batch : bit.ly/spring-live-weekend
    Coupon: TELUSKO10 (10% Discount)
    Master Java Spring Development : bit.ly/java-spring-cloud
    Udemy Courses:
    Java:- bit.ly/JavaUdemyTelusko
    Spring:- bit.ly/SpringUdemyTelusko
    Java For Programmers:- bit.ly/javaProgrammers
    For More Queries WhatsApp or Call on : +919008963671
    website : courses.telusko.com/
    In this lecture we will learn:
    - Constructors in Java
    - Super method in Java
    - Object class in Java
    - This method in Java
    - Similarities in between this() and super() method
    #1
    - Whenever you call an object, it will create a constructor of a class.
    - When we create an object of a class that it calls the constructor of a sub-class as well as a constructor of a superclass.
    - If you do not pass any value in an object, then it will call the default constructor of a class.
    - But if you pass the value in an object, then it will call the parameterised constructor of that class.
    #2
    Super() method:-
    - Every constructor in Java has a method, even if you do not mention it.
    - By default, the first statement in every constructor is a method called a super() method.
    - Super() method means calls the constructor of a superclass.
    - If you do not pass any parameter in a super method, then it will call the default constructor of a superclass.
    - If you pass any parameter in a super method, then it will call the parameterised constructor of a superclass.
    - To call the parameterised constructor of a parent class, we need to explicitly call the super method.
    #3
    Object class:-
    - Every class in Java extends the Object class, even if you do not mention it.
    - Object is a class in Java that contains a lot of methods.
    - So, the super method of a superclass calls the constructor of an object class.
    - There is multi-level inheritance in this concept.
    #4
    This() method:-
    - this() method calls the constructor of the same class.
    - If you do not pass any parameter in this method, then it will call the default constructor of the same class.
    - If you pass any parameter in this method, then it will call the parameterised constructor of the same class.
    #5
    Similarities in between this() and super() method:-
    - We can use both this and super method anywhere except the static area.
    - Both this and super method can be used any number of times in a code.
    But both can be used only one time inside a constructor.
    - Both are non-static keywords.
    Github repo : github.com/navinreddy20/Javac...
    Java:- bit.ly/JavaUdemyTelusko
    Spring:- bit.ly/SpringUdemyTelusko
    More Learning :
    Java :- bit.ly/3x6rr0N
    Python :- bit.ly/3GRc7JX
    Django :- bit.ly/3MmoJK6
    JavaScript :- bit.ly/3tiAlHo
    Node JS :- bit.ly/3GT4liq
    Rest Api :-bit.ly/3MjhZwt
    Servlet :- bit.ly/3Q7eA7k
    Spring Framework :- bit.ly/3xi7buh
    Design Patterns in Java :- bit.ly/3MocXiq
    Docker :- bit.ly/3xjWzLA
    Blockchain Tutorial :- bit.ly/3NSbOkc
    Corda Tutorial:- bit.ly/3thbUKa
    Hyperledger Fabric :- bit.ly/38RZCRB
    NoSQL Tutorial :- bit.ly/3aJpRuc
    Mysql Tutorial :- bit.ly/3thpr4L
    Data Structures using Java :- bit.ly/3MuJa7S
    Git Tutorial :- bit.ly/3NXyCPu
    Donation:
    PayPal Id : navinreddy20
    www.telusko.com
  • НаукаНаука

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

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

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

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

    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.

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

    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

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

    Literally sir, so thankful to you ...what an amazing way to clear the depth topics....Hats off sir

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

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

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

    You are an amazing teacher but pls reorder the playlist!

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

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

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

    Very enlightening video, congrats!

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

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

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

    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 👍

  • @shantanukulkarni8883
    @shantanukulkarni8883 7 месяцев назад +10

    Thank you for introducing me to John Cena memes

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

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

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

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

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

    Thank you for the knowledge.

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

    Very nice explanation sir

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

    That's a deep explanation bro, thank you

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

    Thank you for sharing..

  • @user-bv5yv2ev5t
    @user-bv5yv2ev5t 3 месяца назад

    Wow, terrific explanation!

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

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

  • @krishnapatel-ys7nk
    @krishnapatel-ys7nk 4 месяца назад +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 ...

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

    excellent tutorial Sir.

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

    efficiently taught

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

    Thanks alot

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

    Wow , amazing

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

    It is indeed fun haha! great videos!

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

    Now this was a good video, I liked it

  • @studychannel-xs5hu
    @studychannel-xs5hu Месяц назад

    thanks sir

  • @user-si5wt1pu2o
    @user-si5wt1pu2o 8 месяцев назад

    Tq Sir Very Nice

  • @RaviKumar-zb8bl
    @RaviKumar-zb8bl 6 месяцев назад

    thanks

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

    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.

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

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

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

    Explanation ❤

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

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

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

    helpful :D

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

    you're damn good

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

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

  • @tanujbhatt2184
    @tanujbhatt2184 10 месяцев назад +2

    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

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

    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 2 месяца назад +1

      Same question

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

    Sir can you please provide the notes of this course?

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

    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

  • @user-hf5vp4hg2i
    @user-hf5vp4hg2i Месяц назад

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

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

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

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

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

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

    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!

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

    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 8 месяцев назад

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

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

  • @user-gd3zc4hj8j
    @user-gd3zc4hj8j 4 месяца назад

    ❤❤❤❤

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

    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.

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

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

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

    sir ,the order of videos is misplaced

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

    i love you.

  • @user-qn7lt2xb1n
    @user-qn7lt2xb1n Месяц назад

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

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

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

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

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

    hahaha the John Cena meme, that was funny

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

    i think inheritence is video number 48

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

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

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

    2nd comment

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

    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
    }
    }

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

    John Cena is there and can't see

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

    May be its first comment

  • @TheGloriousOne0
    @TheGloriousOne0 23 дня назад

    Jhon Cena ❤😂

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

    are mughe chakkar aarhe hain

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

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