Showing posts with label Super Keyword. Show all posts
Showing posts with label Super Keyword. Show all posts

Constructor Chaining in Java

  • 0
     In the professional language, A constructor is a subroutine which is called at the time of creation of object of a class. Well, Constructor is a very special method that does not has a return type, not even void. The job of this special method is to initialise the object with default values. If you don't create it explicitly, Java does it for you. This special method is called as soon as an instance of the class.

Super Keyword in Java

Super keyword is one of the most confusing an exciting features of Java. In this article, I will try to demonstrate the two uses of super keyword. The two uses of super keyword are
  1. to call the constructor of immediate Superclass of subclass. Subclass is the one who has has inherited, and Superclass is the one who has been inherited.
  2. to call and access hidden members of Superclass.