Saturday, October 1, 2011

Difference between this and super?

This is used to invoke constructor of same class.
Super is used to invoke constructor of super class.


Example:


 class Two extends One
{
   Protected String name;
   public Two(String name)
      {
          super( "super class" );
          this.name = name; 
      }
}

 Find more about this and super please click here

No comments:

Post a Comment