First, consider an example:
class Foo
{
int attribute1, attribute2;
virtual void Foo1()
{ }
virtual void Foo2()
{ }
};
class ExactDuplicate: Foo
{
virtual void Foo1()
{ }
};
class ExtraMethods: Foo
{
virtual void Foo3()
{ }
};
class ExtraAttributes: Foo
{
int attribute3;
};
I had a discussion - with my teacher - about the relationship "there is A" and "like A", and how they differ.
( -, ) , " " , , , "" , , ExactDuplicate, ExtraMethods ExtraAttributes " A" Foo. " A" , , ExactDuplicate "" ExtraMethods ExtraAttributes, .
, "" , , "A" Foo ExactDuplicate. " A" , , " A" Foo ExtraMethods ExtraAttributes.
, "is A", , , , . . , a Car " " Vehicle, " A" Vehicle, Van " A" Car, .
, ?, .
, , " A" , , " A" ? ( ) .
, .
:)