Variables In 'Solidity'(Learn 'Solidity' - Part 6)

in #ethereum7 years ago

Solidity is a statically typed language, i.e., the type of variable needs to be declared before the compile time, that's why it is important to define the type of variable.

 
 

String

Capture3.JPG

 

This is how we declare 'string' variables in Solidity.

 
 

Other Types Of Variables In Solidity

 

  • BOOL - Boolean variable

  • INT/UINT - Integers

  • ADDRESS - It represents a 20-byte value which is stored in an Ethereum Address.

  • BYTES 1 THROUGH 32 - For Fixed-Sized Byte Arrays

  • BYTES - For Dynamic-Sized Byte Arrays

  • MAPPING - Hash tables with Key types and Value types

  • STRUCT - Allows you to find new types

 

 

We are going to cover all these in great detail throughout our series.

Capture4.JPG

 

We have created a new variable 'age' and you will be able to see a new contract at the right-hand side of the window after you hit 'Deploy'.

 
 

 
 


 

Previous Posts

 

Introduction To 'Solidity'(Learn 'Solidity' - Part 1)

 

Ethereum & Smart Contracts(Learn 'Solidity' - Part 2)

 

Tips To Learn 'Solidity' On Your Own(Learn 'Solidity - Part 3)

 

Basic Smart Contract(Learn 'Solidity' - Part 4)

 

Smart Contract VsnDApp(Learn 'Solidity' - Part 5)

 
 


 

Upcoming Posts

 

Visibility & Structs In Solidity(Learn 'Solidity - Part 7)

Coin Marketplace

STEEM 0.22
TRX 0.27
JST 0.041
BTC 102915.54
ETH 3788.98
USDT 1.00
SBD 3.28