Quiz Entry - updated: 2026.07.30
What are the four function/variable visibility specifiers in Solidity?
public, private, external, and internal — they control who is allowed to call a function or read a variable.
* Who can reach what: public is open to all three callers, external only to the outside, internal to this contract and its children, private to this contract alone *
| Specifier | Who can access it |
|---|---|
public |
Anyone — callable from inside the contract, from derived contracts, and from outside |
private |
Only this exact contract (not even child contracts) |
internal |
This contract and contracts that inherit from it |
external |
Only callers outside the contract (not internal calls) |
If you give a function or variable no specifier, it defaults to internal. That is why an unmarked variable does not show up as a callable button in Remix — outsiders cannot reach it. Note private does not mean the data is secret: everything on a public blockchain is readable off-chain; it only restricts which code may call the accessor.
Go deeper:
Solidity docs: visibility and getters — the precise rules for public/private/internal/external.