100 Days Of Solidity, Shadowing State Variables, Inherited State Variables, Learn Solidity.
with Different Variable Type: contract A { uint256 public number = 42; function getNumber() public view returns (uint256) { return number; } } contract D is A { constructor() { number = 24; } // D.getNumber returns 24 } In this example, contract D inherits the `number` state variable from contract