1. Both super() and this() functions are used to make constructor calls. this() is used to call the current class constructor, while super() is used to call the base class’s constructor.
2. But we can’t use both this() and super() together in a constructor, as it will give a compile-time error.
3. Because super() and this() must be the first executable statement, if anyone is written first, the other will become the second statement and vice-versa. That's why we can't use this() and super() together.
Posted Date:- 2021-09-30 00:36:20