chapter25-code-8

PHOTO EMBED

Thu Mar 30 2023 11:40:48 GMT+0000 (Coordinated Universal Time)

Saved by @RareSkills

contract Parent {
	string private name;

	constructor(string memory _name) {
		name = _name;
	}

	function getName() public view virtual returns (string memory) {
		return name;
	}
}

// fixed
contract Child is Parent("The Beatles") {

	function getName() public view override returns (string memory) {
		return super.getName();
	}
}
content_copyCOPY