How are this() and super() used with constructors?
this() constructor is invoked within a method of a class, if the execution of the constructor is to be done before the functionality of that method.
Example void getValue()
{
this();
…
}
super() constructor is used within the constructor of the sub class, as the very first statement. This process is used when the super class constructor is to be invoked first, when the sub class object is instantiated everytime.
Example class SubClass
{
SubClass()
{
super();
…..
}
}