You can do this. I have shared the code for it. I have checked it and it works.
pragma solidity >0.4.23 <0.5.0;
contract A {
uint256 value;
constructor(uint256 v) public {
value = v;
}
function getValue() external view returns (uint256) {
return value;
}
}
contract B {
A other;
constructor(address a) public {
other = A(a);
}
function getValueFromA() external view returns (uint256) {
return other.getValue();
}
}
Execution:
$ truffle console
truffle(development)> var aContract = web3.eth.contract([{"constant":true,"inputs":[],"name":"getValue","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"v","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"}]);
truffle(development)> var transObj = { from: web3.eth.accounts[0], data: '0x608060405234801561001057600080fd5b506040516020806100ea83398101806040528101908080519060200190929190505050806000819055505060a1806100496000396000f300608060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806320965255146044575b600080fd5b348015604f57600080fd5b506056606c565b6040518082815260200191505060405180910390f35b600080549050905600a165627a7a72305820dd332a08d090a6766cf7c2e86f41abc58a31e4d1afe7cb635a0a1b755a9b81cd0029', gas: '4700000'};
truffle(development)> var a = aContract.new(35, transObj);
truffle(development)> a.getValue();
BigNumber { s: 1, e: 1, c: [ 35 ] }
truffle(development)> var bContract = web3.eth.contract([{"constant":true,"inputs":[],"name":"getValueFromA","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"a","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"}]);
truffle(development)> transObj.data = '0x608060405234801561001057600080fd5b506040516020806101e783398101806040528101908080519060200190929190505050806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610164806100836000396000f300608060405260043610610041576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680639b9be7cd14610046575b600080fd5b34801561005257600080fd5b5061005b610071565b6040518082815260200191505060405180910390f35b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663209652556040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1580156100f857600080fd5b505af115801561010c573d6000803e3d6000fd5b505050506040513d602081101561012257600080fd5b81019080805190602001909291905050509050905600a165627a7a7230582096cc7381535016229911569ae3821103afb9a1ce582f3fc7bf226f3b5fac72380029';
truffle(development)> b = bContract.new(a.address, transObj);
truffle(development)> b.getValueFromA();
BigNumber { s: 1, e: 1, c: [ 35 ] }