Share:
Notifications
Clear all

Earn While Learning Web3 Programming>> Start Here FREE!!!

[Solved] What Is The Difference Between State Variable and Local Variable in Solidity

1 Posts
1 Users
2 Reactions
477 Views
1
Topic starter

What Is The Difference Between State Variable and Local Variable in Solidity

1 Answer
1
Topic starter

The major difference between State Variable and Local Variable in Solidity is that:

State Variable is a type of variable declared with the Global Scope of the Smart contract and it is available to be called and interacted with by any Function in the solidity contract.

While

Local Variable is a type of Variable declared with a specific Function and it is usually available only for use within the Function within which it was declared.

 

NOTE:

This Is An Exercise From Our FREE Smart Contract Development With Solidity For Beginners Course (If you have not enrolled yet, you can join the course totally for FREE).

 

Share: