Super and this keyword in java | What is this and super in java ? Java tutorials

Поделиться
HTML-код
  • Опубликовано: 2 окт 2024
  • What is super keyword ?
    What are the uses of super keyword ?
    What is this keyword ?
    The super keyword used for two purposes:
    If the super class instance variable name is same as that of the child class or subclass instance variable name, then super keyword is used only inside the subclass to access the super class instance variable.
    Java uses super keyword for explicitly calling the super class constructor within the child class constructor
    this keyword :
    this Keyword is used to refer the current class instance variables.
    Used to invoke current class methods.
    Used to call current class constructor.
    To reuse the constructor we use this keyword.
    Thank you for watching !
    if anyone is interested to learn java in depth through live classes or one to one sessions then you can connect with us on below :
    mail : sjprogrammingsolutions@gmail.com
    #javaprogramming #superkeyword #thiskeyword #inheritance #sjprogrammingsolutions

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