Solidity Programming Language – Calling Parent Function
In Solidity, if you have a contract that inherits from another contract, you can call functions from the parent contract using the super
keyword. This allows you to execute the logic defined in the parent contract’s functions within the context of the child contract.
By using super
, you ensure that both the parent and child contract logic is executed when you call the child function.
Code:
Output: