<s>
Multiple	B-Application
inheritance	I-Application
is	O
a	O
feature	O
of	O
some	O
object-oriented	B-Language
computer	I-Language
programming	I-Language
languages	O
in	O
which	O
an	O
object	O
or	O
class	O
can	O
inherit	B-Language
features	O
from	O
more	O
than	O
one	O
parent	O
object	O
or	O
parent	O
class	O
.	O
</s>
<s>
It	O
is	O
distinct	O
from	O
single	O
inheritance	B-Language
,	O
where	O
an	O
object	O
or	O
class	O
may	O
only	O
inherit	B-Language
from	O
one	O
particular	O
object	O
or	O
class	O
.	O
</s>
<s>
Multiple	B-Application
inheritance	I-Application
has	O
been	O
a	O
controversial	O
issue	O
for	O
many	O
years	O
,	O
with	O
opponents	O
pointing	O
to	O
its	O
increased	O
complexity	O
and	O
ambiguity	O
in	O
situations	O
such	O
as	O
the	O
"	O
diamond	O
problem	O
"	O
,	O
where	O
it	O
may	O
be	O
ambiguous	O
as	O
to	O
which	O
parent	O
class	O
a	O
particular	O
feature	O
is	O
inherited	O
from	O
if	O
more	O
than	O
one	O
parent	O
class	O
implements	B-Language
said	O
feature	O
.	O
</s>
<s>
This	O
can	O
be	O
addressed	O
in	O
various	O
ways	O
,	O
including	O
using	O
virtual	B-Application
inheritance	I-Application
.	O
</s>
<s>
Alternate	O
methods	O
of	O
object	B-Language
composition	I-Language
not	O
based	O
on	O
inheritance	B-Language
such	O
as	O
mixins	B-Language
and	O
traits	O
have	O
also	O
been	O
proposed	O
to	O
address	O
the	O
ambiguity	O
.	O
</s>
<s>
In	O
object-oriented	B-Language
programming	I-Language
(	O
OOP	O
)	O
,	O
inheritance	B-Language
describes	O
a	O
relationship	O
between	O
two	O
classes	O
in	O
which	O
one	O
class	O
(	O
the	O
child	O
class	O
)	O
subclasses	O
the	O
parent	O
class	O
.	O
</s>
<s>
Multiple	B-Application
inheritance	I-Application
allows	O
programmers	O
to	O
use	O
more	O
than	O
one	O
totally	O
orthogonal	O
hierarchy	O
simultaneously	O
,	O
such	O
as	O
allowing	O
Cat	O
to	O
inherit	B-Language
from	O
Cartoon	O
character	O
and	O
Pet	O
and	O
Mammal	O
and	O
access	O
features	O
from	O
within	O
all	O
of	O
those	O
classes	O
.	O
</s>
<s>
Languages	O
that	O
support	O
multiple	B-Application
inheritance	I-Application
include	O
:	O
C++	B-Language
,	O
Common	B-Language
Lisp	I-Language
(	O
via	O
Common	B-Application
Lisp	I-Application
Object	I-Application
System	I-Application
(	O
CLOS	B-Application
)	O
)	O
,	O
EuLisp	B-Language
(	O
via	O
The	O
EuLisp	B-Language
Object	B-Language
System	I-Language
TELOS	O
)	O
,	O
Curl	B-Language
,	O
Dylan	B-Language
,	O
Eiffel	B-Language
,	O
Logtalk	B-Language
,	O
Object	B-Application
REXX	I-Application
,	O
Scala	B-Application
(	O
via	O
use	O
of	O
mixin	B-Language
classes	I-Language
)	O
,	O
OCaml	B-Language
,	O
Perl	B-Language
,	O
POP-11	B-Language
,	O
Python	B-Language
,	O
R	B-Language
,	O
Raku	B-Application
,	O
and	O
Tcl	B-Operating_System
(	O
built-in	O
from	O
8.6	O
or	O
via	O
Incremental	O
Tcl	B-Operating_System
(	O
Incr	B-Application
Tcl	I-Application
)	O
in	O
earlier	O
versions	O
)	O
.	O
</s>
<s>
IBM	B-Device
System	I-Device
Object	I-Device
Model	I-Device
(	O
SOM	O
)	O
runtime	O
supports	O
multiple	B-Application
inheritance	I-Application
,	O
and	O
any	O
programming	O
language	O
targeting	O
SOM	O
can	O
implement	O
new	O
SOM	O
classes	O
inherited	O
from	O
multiple	O
bases	O
.	O
</s>
<s>
Some	O
object-oriented	B-Language
languages	I-Language
,	O
such	O
as	O
Swift	B-Application
,	O
Java	B-Language
,	O
Fortran	B-Application
since	O
its	O
2003	O
revision	O
,	O
C#	B-Application
,	O
and	O
Ruby	B-Language
implement	O
single	O
inheritance	B-Language
,	O
although	O
protocols	B-Application
,	O
or	O
interfaces	B-Language
,	O
provide	O
some	O
of	O
the	O
functionality	O
of	O
true	O
multiple	B-Application
inheritance	I-Application
.	O
</s>
<s>
PHP	B-Application
uses	O
traits	O
classes	O
to	O
inherit	B-Language
specific	O
method	O
implementations	O
.	O
</s>
<s>
Ruby	B-Language
uses	O
modules	B-Architecture
to	O
inherit	B-Language
multiple	O
methods	O
.	O
</s>
<s>
The	O
"	O
diamond	O
problem	O
"	O
(	O
sometimes	O
referred	O
to	O
as	O
the	O
"	O
Deadly	O
Diamond	O
of	O
Death	O
"	O
)	O
is	O
an	O
ambiguity	O
that	O
arises	O
when	O
two	O
classes	O
B	O
and	O
C	O
inherit	B-Language
from	O
A	O
,	O
and	O
class	O
D	B-Application
inherits	O
from	O
both	O
B	O
and	O
C	O
.	O
If	O
there	O
is	O
a	O
method	O
in	O
A	O
that	O
B	O
and	O
C	O
have	O
overridden	B-Language
,	O
and	O
D	B-Application
does	O
not	O
override	B-Language
it	O
,	O
then	O
which	O
version	O
of	O
the	O
method	O
does	O
D	B-Application
inherit	B-Language
:	O
that	O
of	O
B	O
,	O
or	O
that	O
of	O
C	O
?	O
</s>
<s>
For	O
example	O
,	O
in	O
the	O
context	O
of	O
GUI	B-Application
software	O
development	O
,	O
a	O
class	O
Button	O
may	O
inherit	B-Language
from	O
both	O
classes	O
Rectangle	O
(	O
for	O
appearance	O
)	O
and	O
Clickable	O
(	O
for	O
functionality/input	O
handling	O
)	O
,	O
and	O
classes	O
Rectangle	O
and	O
Clickable	O
both	O
inherit	B-Language
from	O
the	O
Object	O
class	O
.	O
</s>
<s>
Now	O
if	O
the	O
equals	O
method	O
is	O
called	O
for	O
a	O
Button	O
object	O
and	O
there	O
is	O
no	O
such	O
method	O
in	O
the	O
Button	O
class	O
but	O
there	O
is	O
an	O
overridden	B-Language
equals	O
method	O
in	O
Rectangle	O
or	O
Clickable	O
(	O
or	O
both	O
)	O
,	O
which	O
method	O
should	O
be	O
eventually	O
called	O
?	O
</s>
<s>
It	O
is	O
called	O
the	O
"	O
diamond	O
problem	O
"	O
because	O
of	O
the	O
shape	O
of	O
the	O
class	B-Language
inheritance	I-Language
diagram	O
in	O
this	O
situation	O
.	O
</s>
<s>
In	O
this	O
case	O
,	O
class	O
A	O
is	O
at	O
the	O
top	O
,	O
both	O
B	O
and	O
C	O
separately	O
beneath	O
it	O
,	O
and	O
D	B-Application
joins	O
the	O
two	O
together	O
at	O
the	O
bottom	O
to	O
form	O
a	O
diamond	O
shape	O
.	O
</s>
<s>
Languages	O
have	O
different	O
ways	O
of	O
dealing	O
with	O
these	O
problems	O
of	O
repeated	O
inheritance	B-Language
.	O
</s>
<s>
C#	B-Application
(	O
since	O
C#	B-Application
8.0	O
)	O
allows	O
default	O
interface	O
method	O
implementation	O
,	O
causing	O
a	O
class	O
A	O
,	O
implementing	O
interfaces	B-Language
Ia	O
and	O
Ib	O
with	O
similar	O
methods	O
having	O
default	O
implementations	O
,	O
to	O
have	O
two	O
"	O
inherited	O
"	O
methods	O
with	O
the	O
same	O
signature	O
,	O
causing	O
the	O
diamond	O
problem	O
.	O
</s>
<s>
C++	B-Language
by	O
default	O
follows	O
each	O
inheritance	B-Language
path	O
separately	O
,	O
so	O
a	O
D	B-Application
object	O
would	O
actually	O
contain	O
two	O
separate	O
A	O
objects	O
,	O
and	O
uses	O
of	O
A	O
's	O
members	O
have	O
to	O
be	O
properly	O
qualified	O
.	O
</s>
<s>
If	O
the	O
inheritance	B-Language
from	O
A	O
to	O
B	O
and	O
the	O
inheritance	B-Language
from	O
A	O
to	O
C	O
are	O
both	O
marked	O
"	O
virtual	O
"	O
(	O
for	O
example	O
,	O
"	O
class	O
B	O
:	O
virtual	O
public	O
A	O
"	O
)	O
,	O
C++	B-Language
takes	O
special	O
care	O
to	O
only	O
create	O
one	O
A	O
object	O
,	O
and	O
uses	O
of	O
A	O
's	O
members	O
work	O
correctly	O
.	O
</s>
<s>
If	O
virtual	B-Application
inheritance	I-Application
and	O
nonvirtual	O
inheritance	B-Language
are	O
mixed	O
,	O
there	O
is	O
a	O
single	O
virtual	O
A	O
,	O
and	O
a	O
nonvirtual	O
A	O
for	O
each	O
nonvirtual	O
inheritance	B-Language
path	O
to	O
A	O
.	O
C++	B-Language
requires	O
stating	O
explicitly	O
which	O
parent	O
class	O
the	O
feature	O
to	O
be	O
used	O
is	O
invoked	O
from	O
i.e.	O
</s>
<s>
C++	B-Language
does	O
not	O
support	O
explicit	O
repeated	O
inheritance	B-Language
since	O
there	O
would	O
be	O
no	O
way	O
to	O
qualify	O
which	O
superclass	O
to	O
use	O
(	O
i.e.	O
</s>
<s>
C++	B-Language
also	O
allows	O
a	O
single	O
instance	O
of	O
the	O
multiple	O
class	O
to	O
be	O
created	O
via	O
the	O
virtual	B-Application
inheritance	I-Application
mechanism	O
(	O
i.e.	O
</s>
<s>
Common	B-Language
Lisp	I-Language
CLOS	B-Application
attempts	O
to	O
provide	O
both	O
reasonable	O
default	O
behavior	O
and	O
the	O
ability	O
to	O
override	B-Language
it	O
.	O
</s>
<s>
By	O
default	O
,	O
to	O
put	O
it	O
simply	O
,	O
the	O
methods	O
are	O
sorted	O
in	O
D	B-Application
,	O
B	O
,	O
C	O
,	O
A	O
,	O
when	O
B	O
is	O
written	O
before	O
C	O
in	O
the	O
class	O
definition	O
.	O
</s>
<s>
The	O
method	O
with	O
the	O
most	O
specific	O
argument	O
classes	O
is	O
chosen	O
(	O
D>(B,C )	O
>A	O
)	O
;	O
then	O
in	O
the	O
order	O
in	O
which	O
parent	O
classes	O
are	O
named	O
in	O
the	O
subclass	O
definition	O
(	O
B>C	O
)	O
.	O
</s>
<s>
However	O
,	O
the	O
programmer	O
can	O
override	B-Language
this	O
,	O
by	O
giving	O
a	O
specific	O
method	O
resolution	O
order	O
or	O
stating	O
a	O
rule	O
for	O
combining	O
methods	O
.	O
</s>
<s>
The	O
MOP	O
(	O
metaobject	O
protocol	B-Application
)	O
also	O
provides	O
means	O
to	O
modify	O
the	O
inheritance	B-Language
,	O
dynamic	O
dispatch	O
,	O
class	O
instantiation	O
,	O
and	O
other	O
internal	O
mechanisms	O
without	O
affecting	O
the	O
stability	O
of	O
the	O
system	O
.	O
</s>
<s>
Curl	B-Language
allows	O
only	O
classes	O
that	O
are	O
explicitly	O
marked	O
as	O
shared	O
to	O
be	O
inherited	O
repeatedly	O
.	O
</s>
<s>
In	O
Eiffel	B-Language
,	O
the	O
ancestors	O
 '	O
features	O
are	O
chosen	O
explicitly	O
with	O
select	O
and	O
rename	O
directives	O
.	O
</s>
<s>
Eiffel	B-Language
allows	O
explicit	O
joining	O
or	O
separation	O
of	O
features	O
inherited	O
from	O
ancestor	O
classes	O
.	O
</s>
<s>
Eiffel	B-Language
will	O
automatically	O
join	O
features	O
together	O
,	O
if	O
they	O
have	O
the	O
same	O
name	O
and	O
implementation	O
.	O
</s>
<s>
Multiple	B-Application
inheritance	I-Application
is	O
a	O
frequent	O
occurrence	O
in	O
Eiffel	B-Language
development	O
;	O
most	O
of	O
the	O
effective	O
classes	O
in	O
the	O
widely	O
used	O
EiffelBase	O
library	O
of	O
data	O
structures	O
and	O
algorithms	O
,	O
for	O
example	O
,	O
have	O
two	O
or	O
more	O
parents	O
.	O
</s>
<s>
Go	B-Application
prevents	O
the	O
diamond	O
problem	O
at	O
compile	O
time	O
.	O
</s>
<s>
If	O
a	O
structure	O
D	B-Application
embeds	O
two	O
structures	O
B	O
and	O
C	O
which	O
both	O
have	O
a	O
method	O
F( )	O
,	O
thus	O
satisfying	O
an	O
interface	O
A	O
,	O
the	O
compiler	O
will	O
complain	O
about	O
an	O
"	O
ambiguous	O
selector	O
"	O
if	O
D.F( )	O
is	O
called	O
,	O
or	O
if	O
an	O
instance	O
of	O
D	B-Application
is	O
assigned	O
to	O
a	O
variable	O
of	O
type	O
A	O
.	O
</s>
<s>
B	O
and	O
C	O
's	O
methods	O
can	O
be	O
called	O
explicitly	O
with	O
D.B.F( )	O
or	O
D.C.F( )	O
.	O
</s>
<s>
Java	B-Language
8	O
introduces	O
default	O
methods	O
on	O
interfaces	B-Language
.	O
</s>
<s>
If	O
A	O
,	O
B	O
,	O
C	O
are	O
interfaces	B-Language
,	O
B	O
,	O
C	O
can	O
each	O
provide	O
a	O
different	O
implementation	O
to	O
an	O
abstract	O
method	O
of	O
A	O
,	O
causing	O
the	O
diamond	O
problem	O
.	O
</s>
<s>
Either	O
class	O
D	B-Application
must	O
reimplement	O
the	O
method	O
(	O
the	O
body	O
of	O
which	O
can	O
simply	O
forward	O
the	O
call	O
to	O
one	O
of	O
the	O
super	O
implementations	O
)	O
,	O
or	O
the	O
ambiguity	O
will	O
be	O
rejected	O
as	O
a	O
compile	O
error	O
.	O
</s>
<s>
Prior	O
to	O
Java	B-Language
8	O
,	O
Java	B-Language
was	O
not	O
subject	O
to	O
the	O
Diamond	O
problem	O
risk	O
,	O
because	O
it	O
did	O
not	O
support	O
multiple	B-Application
inheritance	I-Application
and	O
interface	O
default	O
methods	O
were	O
not	O
available	O
.	O
</s>
<s>
JavaFX	B-Language
Script	I-Language
in	O
version	O
1.2	O
allows	O
multiple	B-Application
inheritance	I-Application
through	O
the	O
use	O
of	O
mixins	B-Language
.	O
</s>
<s>
Each	O
inherited	O
member	O
can	O
still	O
be	O
accessed	O
by	O
casting	O
the	O
object	O
to	O
the	O
mixin	B-Language
of	O
interest	O
,	O
e.g.	O
</s>
<s>
Kotlin	B-Language
allows	O
multiple	B-Application
inheritance	I-Application
of	O
Interfaces	B-Language
,	O
however	O
,	O
in	O
a	O
Diamond	O
problem	O
scenario	O
,	O
the	O
child	O
class	O
must	O
override	B-Language
the	O
method	O
that	O
causes	O
the	O
inheritance	B-Language
conflict	O
and	O
specify	O
which	O
parent	O
class	O
implementation	O
should	O
be	O
used	O
.	O
</s>
<s>
Logtalk	B-Language
supports	O
both	O
interface	O
and	O
implementation	O
multi-inheritance	B-Application
,	O
allowing	O
the	O
declaration	O
of	O
method	O
aliases	O
that	O
provide	O
both	O
renaming	O
and	O
access	O
to	O
methods	O
that	O
would	O
be	O
masked	O
out	O
by	O
the	O
default	O
conflict	O
resolution	O
mechanism	O
.	O
</s>
<s>
In	O
OCaml	B-Language
,	O
parent	O
classes	O
are	O
specified	O
individually	O
in	O
the	O
body	O
of	O
the	O
class	O
definition	O
.	O
</s>
<s>
Methods	O
(	O
and	O
attributes	O
)	O
are	O
inherited	O
in	O
the	O
same	O
order	O
,	O
with	O
each	O
newly	O
inherited	O
method	B-Language
overriding	I-Language
any	O
existing	O
methods	O
.	O
</s>
<s>
OCaml	B-Language
chooses	O
the	O
last	O
matching	O
definition	O
of	O
a	O
class	B-Language
inheritance	I-Language
list	O
to	O
resolve	O
which	O
method	O
implementation	O
to	O
use	O
under	O
ambiguities	O
.	O
</s>
<s>
To	O
override	B-Language
the	O
default	O
behavior	O
,	O
one	O
simply	O
qualifies	O
a	O
method	O
call	O
with	O
the	O
desired	O
class	O
definition	O
.	O
</s>
<s>
Perl	B-Language
uses	O
the	O
list	O
of	O
classes	O
to	O
inherit	B-Language
from	O
as	O
an	O
ordered	O
list	O
.	O
</s>
<s>
The	O
compiler	O
uses	O
the	O
first	O
method	O
it	O
finds	O
by	O
depth-first	B-Algorithm
searching	O
of	O
the	O
superclass	O
list	O
or	O
using	O
the	O
C3	B-Application
linearization	I-Application
of	O
the	O
class	O
hierarchy	O
.	O
</s>
<s>
The	O
order	O
of	O
inheritance	B-Language
affects	O
the	O
class	O
semantics	O
.	O
</s>
<s>
This	O
is	O
shared	O
with	O
Io	B-Application
and	O
Picolisp	B-Language
.	O
</s>
<s>
In	O
Perl	B-Language
,	O
this	O
behavior	O
can	O
be	O
overridden	B-Language
using	O
the	O
mro	O
or	O
other	O
modules	B-Architecture
to	O
use	O
C3	B-Application
linearization	I-Application
or	O
other	O
algorithms	O
.	O
</s>
<s>
Python	B-Language
has	O
the	O
same	O
structure	O
as	O
Perl	B-Language
,	O
but	O
,	O
unlike	O
Perl	B-Language
,	O
includes	O
it	O
in	O
the	O
syntax	O
of	O
the	O
language	O
.	O
</s>
<s>
The	O
order	O
of	O
inheritance	B-Language
affects	O
the	O
class	O
semantics	O
.	O
</s>
<s>
Python	B-Language
had	O
to	O
deal	O
with	O
this	O
upon	O
the	O
introduction	O
of	O
new-style	O
classes	O
,	O
all	O
of	O
which	O
have	O
a	O
common	O
ancestor	O
,	O
object	O
.	O
</s>
<s>
Python	B-Language
creates	O
a	O
list	O
of	O
classes	O
using	O
the	O
C3	B-Application
linearization	I-Application
(	O
or	O
Method	O
Resolution	O
Order	O
(	O
MRO	O
)	O
)	O
algorithm	O
.	O
</s>
<s>
That	O
algorithm	O
enforces	O
two	O
constraints	O
:	O
children	O
precede	O
their	O
parents	O
and	O
if	O
a	O
class	O
inherits	O
from	O
multiple	O
classes	O
,	O
they	O
are	O
kept	O
in	O
the	O
order	O
specified	O
in	O
the	O
tuple	O
of	O
base	O
classes	O
(	O
however	O
in	O
this	O
case	O
,	O
some	O
classes	O
high	O
in	O
the	O
inheritance	B-Language
graph	O
may	O
precede	O
classes	O
lower	O
in	O
the	O
graph	O
)	O
.	O
</s>
<s>
Thus	O
,	O
the	O
method	O
resolution	O
order	O
is	O
:	O
D	B-Application
,	O
B	O
,	O
C	O
,	O
A	O
.	O
</s>
<s>
Ruby	B-Language
classes	O
have	O
exactly	O
one	O
parent	O
but	O
may	O
also	O
inherit	B-Language
from	O
multiple	O
modules	B-Architecture
;	O
ruby	B-Language
class	O
definitions	O
are	O
executed	O
,	O
and	O
the	O
(	O
re	O
)	O
definition	O
of	O
a	O
method	O
obscures	O
any	O
previously	O
existing	O
definition	O
at	O
the	O
time	O
of	O
execution	O
.	O
</s>
<s>
Scala	B-Application
allows	O
multiple	O
instantiation	O
of	O
traits	O
,	O
which	O
allows	O
for	O
multiple	B-Application
inheritance	I-Application
by	O
adding	O
a	O
distinction	O
between	O
the	O
class	O
hierarchy	O
and	O
the	O
trait	O
hierarchy	O
.	O
</s>
<s>
A	O
class	O
can	O
only	O
inherit	B-Language
from	O
a	O
single	O
class	O
,	O
but	O
can	O
mix-in	O
as	O
many	O
traits	O
as	O
desired	O
.	O
</s>
<s>
Scala	B-Application
resolves	O
method	O
names	O
using	O
a	O
right-first	O
depth-first	B-Algorithm
search	I-Algorithm
of	O
extended	O
'	O
traits	O
 '	O
,	O
before	O
eliminating	O
all	O
but	O
the	O
last	O
occurrence	O
of	O
each	O
module	B-Architecture
in	O
the	O
resulting	O
list	O
.	O
</s>
<s>
So	O
,	O
the	O
resolution	O
order	O
is	O
:	O
[	O
D	B-Application
,	O
C	O
,	O
A	O
,	O
B	O
,	O
A ]	O
,	O
which	O
reduces	O
down	O
to	O
[	O
D	B-Application
,	O
C	O
,	O
B	O
,	O
A ]	O
.	O
</s>
<s>
Tcl	B-Operating_System
allows	O
multiple	O
parent	O
classes	O
;	O
the	O
order	O
of	O
specification	O
in	O
the	O
class	O
declaration	O
affects	O
the	O
name	O
resolution	O
for	O
members	O
using	O
the	O
C3	B-Application
linearization	I-Application
algorithm	O
.	O
</s>
<s>
Languages	O
that	O
allow	O
only	O
single	O
inheritance	B-Language
,	O
where	O
a	O
class	O
can	O
only	O
derive	O
from	O
one	O
base	O
class	O
,	O
do	O
not	O
have	O
the	O
diamond	O
problem	O
.	O
</s>
<s>
The	O
reason	O
for	O
this	O
is	O
that	O
such	O
languages	O
have	O
at	O
most	O
one	O
implementation	O
of	O
any	O
method	O
at	O
any	O
level	O
in	O
the	O
inheritance	B-Language
chain	O
regardless	O
of	O
the	O
repetition	O
or	O
placement	O
of	O
methods	O
.	O
</s>
<s>
Typically	O
these	O
languages	O
allow	O
classes	O
to	O
implement	O
multiple	O
protocols	B-Application
,	O
called	O
interfaces	B-Language
in	O
Java	B-Language
.	O
</s>
<s>
These	O
protocols	B-Application
define	O
methods	O
but	O
do	O
not	O
provide	O
concrete	O
implementations	O
.	O
</s>
<s>
This	O
strategy	O
has	O
been	O
used	O
by	O
ActionScript	B-Operating_System
,	O
C#	B-Application
,	O
D	B-Application
,	O
Java	B-Language
,	O
Nemerle	B-Application
,	O
Object	B-Language
Pascal	I-Language
,	O
Objective-C	B-Language
,	O
Smalltalk	B-Application
,	O
Swift	B-Application
and	O
PHP	B-Application
.	O
</s>
<s>
All	O
these	O
languages	O
allow	O
classes	O
to	O
implement	O
multiple	O
protocols	B-Application
.	O
</s>
<s>
Moreover	O
,	O
Ada	B-Language
,	O
C#	B-Application
,	O
Java	B-Language
,	O
Object	B-Language
Pascal	I-Language
,	O
Objective-C	B-Language
,	O
Swift	B-Application
and	O
PHP	B-Application
allow	O
multiple-inheritance	O
of	O
interfaces	B-Language
(	O
called	O
protocols	B-Application
in	O
Objective-C	B-Language
and	O
Swift	B-Application
)	O
.	O
</s>
<s>
Interfaces	B-Language
are	O
like	O
abstract	O
base	O
classes	O
that	O
specify	O
method	O
signatures	O
without	O
implementing	O
any	O
behaviour	O
.	O
</s>
<s>
(	O
"	O
Pure	O
"	O
interfaces	B-Language
such	O
as	O
the	O
ones	O
in	O
Java	B-Language
up	O
to	O
version	O
7	O
do	O
not	O
permit	O
any	O
implementation	O
or	O
instance	O
data	O
in	O
the	O
interface	O
.	O
)	O
</s>
<s>
Nevertheless	O
,	O
even	O
when	O
several	O
interfaces	B-Language
declare	O
the	O
same	O
method	O
signature	O
,	O
as	O
soon	O
as	O
that	O
method	O
is	O
implemented	O
(	O
defined	O
)	O
anywhere	O
in	O
the	O
inheritance	B-Language
chain	O
,	O
it	O
overrides	B-Language
any	O
implementation	O
of	O
that	O
method	O
in	O
the	O
chain	O
above	O
it	O
(	O
in	O
its	O
superclasses	O
)	O
.	O
</s>
<s>
Hence	O
,	O
at	O
any	O
given	O
level	O
in	O
the	O
inheritance	B-Language
chain	O
,	O
there	O
can	O
be	O
at	O
most	O
one	O
implementation	O
of	O
any	O
method	O
.	O
</s>
<s>
Thus	O
,	O
single-inheritance	O
method	O
implementation	O
does	O
not	O
exhibit	O
the	O
Diamond	O
Problem	O
even	O
with	O
multiple-inheritance	O
of	O
interfaces	B-Language
.	O
</s>
<s>
With	O
the	O
introduction	O
of	O
default	O
implementation	O
for	O
interfaces	B-Language
in	O
Java	B-Language
8	O
and	O
C#	B-Application
8	O
,	O
it	O
is	O
still	O
possible	O
to	O
generate	O
a	O
Diamond	O
Problem	O
,	O
although	O
this	O
will	O
only	O
appear	O
as	O
a	O
compile-time	O
error	O
.	O
</s>
