Testing snippets.. A personal journey blog

https://syedahani1991.wixsite.com/website/post/testing-storiesI'm gonna start a personal blog to specify all the testing concepts i learn in a day.

Today's date is 24th July 2024


Core Java:

Super calling statement: Super calling statement is used in constructor context to call from sub-class constructor to immediate super class constructor


Rules:

  1. super calling statement is used only in case of inheritance.
  2. We cant have a combination of "this" calling statement and super calling statement inside a single constructor.
  3. super() calling statement should always be the first statement inside a constructor.
  4. There can be only one super() calling statement inside a particular constructor
  5. If a user is not writing super calling statement, then compiler will itself write the super calling statement implicitly.
  6. If user writes the super() calling statement explicitly, then the compiler will not write super() calling statement implicitly.

7. If a user defines a super() calling statement without any parameters, then the super() calling statement will call its immediate super class constructor & if the super() calling statement is defined with parameters then it'll match the arguments with the class which has similar arguments and that class will get invoked.

要查看或添加评论,请登录

社区洞察

其他会员也浏览了