Anonymous user
Inheritance/Multiple: Difference between revisions
m
Moved to Basic learning cat
m (→{{header|J}}: Naming revisions.) |
m (Moved to Basic learning cat) |
||
Line 1:
{{Task|Basic language learning}}
Multiple inheritance allows to specify that one class is a subclass of several other classes. Some languages allow multiple [[inheritance]] for arbitrary classes, others restrict it to interfaces, some don't allow it at all.
Write two classes (or interfaces) <code>Camera</code> and <code>MobilePhone</code>, then write a class <code>CameraPhone</code> which is both a <code>Camera</code> and a <code>MobilePhone</code>.
|