what difference in variable this and super.
why Test t = this; and Base b = super ; - not ok?
posted 2 years ago
super can't be used as a reference in the same way this can. It's used in two specific circumstances:
- To call the base class version of a method
- To call a base class constructor
Remember that this refers to a Test object in this case, which is also a Base object. So you can assign this to a Base reference variable. If super was allowed there, what would you expect it to do that is any different?