What is Super Keyword In Java

Поделиться
HTML-код
  • Опубликовано: 18 сен 2024
  • Hello Friends, In this video we'll learn:
    1) 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.
    2)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.

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

  • @Abhishek-df5tf
    @Abhishek-df5tf 16 дней назад

    Mem jdbc, hibernate and spring boot rest API par video banwo full details step by step

  • @Abhishek-df5tf
    @Abhishek-df5tf 16 дней назад

    Mem app kon si company me ho