How are this() and super() used with constructors?5
791 5b5cc7cee4d2b4197775111b
Q: How are this() and super() used with constructors?
- Show Answer
- Workspace
- Discuss
Answer :
Explanation :
Constructors use this to refer to another constructor in the same class with a different parameter list. Constructors use super to invoke the superclass's constructor. If a constructor uses super, it must use it in the first line; otherwise, the compiler will complain.
Similar Questions
Since Nithya and Suganya exchange places, so Rita’s new position is the same as Monika’s earlier position. This position is 17th from the right and 10th from the left. Therefore Number of girls in the row = (16 + 1 + 9) = 26.