pragma solidity 0.8.13;

contract student {
    string public value;

    constructor() public {
        value="sami";
    } 
    
    function set(string memory _value) public {
        value = _value;
    }
    
    function get() public view returns(string memory) {
        return _value;
    }
}
1

There are 1 best solutions below

2
user3804427 On

You have undefined var in get() function "_value". MAy be you what return class var "value"?