pragma solidity ^0.5.2; contract SelfIntroduction { enum Gender { Male, Female, Other } string public name; uint8 public age; Gender public gender; bytes[3] public bytesHobbies; function setData(string memory _name, uint8 _age, Gender _gender, string memory _hobby, uint8 position) public { name = _name; age = _age; gender = _gender; bytes memory bytesHobby = bytes(_hobby); bytesHobbies[position] = bytesHobby; } function getData() public view returns(string memory, uint8, Gender) { return (name, age, gender); } function getHobbyNumber() public view returns(uint) { return bytesHobbies.length; } function getbytesHobby(uint x) public view returns (bytes memory) { return bytesHobbies[x]; } }
0.5.2