Understanding object-orientated programming