Solidity Variables

[Solved] Solidity Variables | Solidity - Code Explorer | yomemimo.com
Question : solidity variables

Answered by : shirshak

contract Varibles {
//like other programming language it contain number,string,boolean
//expect this it contain address and byte32 //type name = value; //declaration int number = 4; //sign and unsign upto 256 bit int16 anotherNumber = 1; //sign and unsign upto 16 bit.It will save gas. uint unsignedNumber = 12;// only positve number bool boolean = true; //true or false address myAddress= "0xFF23E6C7B0D55c796C97ab8aFF1d755F12aFD3C2"; string myName= "Shirshak Kandel"; byte32 position="Full stack";//byte32 convert string into byte which save gas. //state variable => available in whole contract. //localvariable => only available inside function. int public publicVariable = 32;//public is visibility that means we can call //from outside of contact. int internal internalVariable= 1231 // only modified by this contract. int private privateVariable = 987 //only modified by this contract no inheritance
}

Source : | Last Update : Fri, 04 Mar 22

Answers related to solidity variables

Code Explorer Popular Question For Solidity