this and super Keyword

 

  • "this" is used to refer current class Instance Variable.
  • "this" is used to refer to current class Methods.
  • "this()" is used to invoke the current class Constructor.


  • "super" is used to invoke the Instance Variable of Parent Class.
  • "super" is used to invoke a method of Parent class/Super Class.
  • "super()" is used to invoke a constructor of Parent class/Super Class.

Comments

Popular Posts