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

in #ethereum6 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.29
TRX 0.12
JST 0.033
BTC 63071.06
ETH 3121.31
USDT 1.00
SBD 3.84