Solidity – Understanding ‘=>’ in Mapping Function

contract-developmentsolidity

I'm very new to actual programming not as much blockchain. I know a little Java and am trying to learn solidity I am reading through the Intro to smart contracts turotial and on the 7th line (see below) they declare a variable using mapping but I don't understand how the => comes into play.

mapping (address => uint) public balances;

Best Answer

mapping is similar to Dictionary in Java where you specify key and value pair like

var mydictionary = new Dictionary(key,value);

while in solidity you use the same with => ; where Key = address and uint as value.

Related Topic