contract
Estimated reading time: 1 minutecontract
as like other oop language solidity has contract that is similar to class.
contract Code4mk {
// code will be here
}
visibility
Solidity has 4 types visibility.
- external
- internal
- public
- private
external
external
function can accessable from own contract and other contract too.
function test() pure external returns(string memory){
return('external function');
}
- access by
this.f()
public
public
access from any where as like other oop language.
internal
internal
only accessable from internally.