TDPL 6.4.3 Overriding Is Only Voluntary

Caligo iteronvexor at gmail.com
Tue Mar 22 18:10:04 PDT 2011


"The override keyword in the signature of Friend.bgColor is required," (193)

This code compiles:

class Contact{ string bgColor(){ return ""; } }
class Friend : Contact{
    string bgColor(){ return "LightGreen"; }
}

So how is 'override' required?  Can I get an example of where
'override' makes a difference?


More information about the Digitalmars-d-learn mailing list