Inheritance/Multiple: Difference between revisions

m
Line 654:
 
=={{header|Julia}}==
Julia supports inheritance via abstract types. In Julia, multiple dispatch allows objects of different types to have the same function interfaces. Julia also can support traits via parameters in type declarations or with macros. This makes multiple inheritance in Julia mostly unnecessary, except for the inconvenience of composing the data in a mixed type when declaring mutiple similar types, for which there are macros.<br /> <br />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}}==
4,102

edits