Inheritance/Multiple: Difference between revisions
Content deleted Content added
Add Factor example |
|||
Line 652:
{{omit|Julia}}
=={{header|Julia}}==
Julia supports inheritance via abstract types. In Julia, multiple dispatch allows objects of different types to have the same function interfaces. This makes multiple inheritance unnecessary, except for the convenience of composing the data in a mixed type, for which there are macros. For example, the functions <code> scan(equipment, sheet) </code> and <code> lineprint(equipment, file) </code> could be used as generic interfaces to implement methods for a <code>Printer</code>, a <code>Scanner</code>, and a <code>MultiFunctionPrinter</code>, and Julia would dispatch according to the type of the equipment.
=={{header|Kotlin}}==
|