I'm trying to learn Solidity and I came across the following 2 contracts:
pong holds some value, and the contract
ping is supposed to be able to access this value via the
getPongvalTransactional function. I'm confused with how this function works (disclaimer: I have no background in object oriented programming).
If I understand correctly, in the
ping contract, all contracts of type
PongvalRetriever contain a function called
getPongvalTransactional which returns
pong contract address is declared to be a contract of type
However, the pong contract also contains a function called
getPongvalTransactional which returns the actual value we want. In following line of the ping contract
pongval = pvr.getPongvalTransactional();
pongval equal the actual pong value instead of -1?