solidity基础-继承-is

父合约

contract fruit{

   string public name = 'eat';
}

继承

import "/4_.sol";
contract Apple is fruit {

  function getType() external view returns(string memory) {
    return name;
  }

}

  

posted @ 2022-06-09 23:43  apeNote  阅读(22)  评论(0编辑  收藏  举报