When the contract needs to interact with other contracts on the block chain and when:
You need to define an interface (Interface)
definition:
contract Number{
function getNum(address _myAddress) public view returns (uint);
}
While here, it looked like a contract and defined inside a function, however:
Function did not begin, but the use of a semicolon immediate end, which is the definition of some of the features interface interface.