Inheritance/Multiple: Difference between revisions

m
added a ";task:" and whitespace.
No edit summary
m (added a ";task:" and whitespace.)
Line 1:
{{Task|Basic language learning}}
[[Category:Object oriented]] [[Category:Type System]]
[[Category:Type System]]
 
Multiple inheritance allows to specify that one [[classes | 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.
 
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) <tt>Camera</tt> and <tt>MobilePhone</tt>,
 
then write a class <tt>CameraPhone</tt> which is both a <tt>Camera</tt> and
 
a <tt>MobilePhone</tt>.
;Task:
Write two classes (or interfaces) <tt>Camera</tt> and <tt>MobilePhone</tt>, &nbsp; then write a class <tt>CameraPhone</tt> which is both a <tt>Camera</tt> and a <tt>MobilePhone</tt>.
 
There is no need to implement any functions for those classes.
<br><br>
 
=={{header|Ada}}==