How are this() and super() used with constructors ?

Discussion in 'Java Language Basics/Fundamentals' started by SoCoooollllllllllllllllll, Nov 2, 2008.

  1. this() is used to invoke a constructor of the same Class. super() is used to invoke a SuperClass constructor.
     
  2. anneroberts

    anneroberts Member

    Constructors use this to accredit to addition architect in the aforementioned chic with a altered constant list. Constructors use cool to adjure the superclass's constructor. If a architect uses super, it charge use it in the aboriginal line; otherwise, the compiler will complain.
     

Share This Page