pragma solidity ^0.4.18; contract A { uint public variable = 2; } contract B { A private a = new A(); function check() view public returns (uint) { // notice because variable doesn't belong to B // it has to be called as a function return a.variable(); } }
0.4.24