Constructor

The constructor method is a special method for creating and initializing a contract. In solidity v0.4.23, Solidity introduced this new constructor notation and the old one was deprecated.

//new
pragma solidity ^0.4.24;
contract HelloWorld {
function constructor() public {
// ...
}
}
//deprecated
pragma solidity ^0.4.22;
contract HelloWorld {
function HelloWorld () public {
// ...
}
}