Yes, this code will work just fine. When you inherit a contract, only one contract will be created during deployment. So when you inherit a contract then the child contract will have the contents of the parent contact. Look at this example and understanding how you can implement it:
pragma solidity ^0.4.18;
contract A {
uint256 public balance;
function() public payable {
balance = msg.value;
}
}
contract B is A {
uint256 i;
A a;
function B(address _a) public {
a = A(_a);
}
function receiveForParent() public payable {
a.transfer(msg.value);
}
function getParentBalance() public constant returns (uint256) {
return a.balance();
}
}