The difference between this and super

A key difference between this and super

1. If subclass constructor a reference to super, they must first place the super function.
2.super (parameters): invoke a constructor of a base class (constructor should be the first statement)
3.this (parameters): call the constructor for this class of another form (it should be the first statement in the constructor)
4.super :? member that references the direct parent of the current object (used for direct parent class hidden parent class data members or functions,
the base class and a derived class with the same members as defined when: super super variable name data member function name (argument)..
5.this: it represents the current object name (easy to produce the bis ambiguity in the program, this should be used to indicate the current object;
if the shape function of the same name of the participating members of the class data, then required to indicate this member variable name)

Guess you like

Origin www.cnblogs.com/gpxs/p/11653364.html