반응형
contract Father{
uint256 public fatherMoney = 100;
function getFatherName() public pure returns(string memory){
return "KimJung";
}
function getMoney() public view virtual returns(uint256){
return fatherMoney;
}
}
contract Mother{
uint256 public motherMoney = 100;
function getMotherName() public pure returns(string memory){
return "LeeDae";
}
function getMoney() public view virtual returns(uint256){
return motherMoney;
}
}
contract Son is Father, Mother{
function getMoney() public view override(Father, Mother) returns(uint256){
return fatherMoney + motherMoney;
}
}
반응형