Value and Reference Types
Learn about value and reference types in Solidity.
We'll cover the following
Solidity is a statically typed language, and it’s necessary to specify the type of each variable. The compiler can verify the proper use of the variables by their data types. The zero state default values for the defined types include certain preset values, such as false
for the bool
type. Solidity features value and reference types like the other statically typed languages.
Value types
Variables of a value type contain their distinct data. These data types are the foundational building blocks provided by Solidity. They are always passed by value, meaning that a duplicate copy of them is created whenever these variables are used as function parameters or for assignment. Here’s a list of value type data types in Solidity:
Get hands-on with 1200+ tech skills courses.