Wrapper function: Difference between revisions

Content deleted Content added
No edit summary
Line 22:
 
===Multiple inheritance===
In a [[programming language]] that does not support [[multiple inheritance]] of base classes, wrapper functions can be used to simulate it. Below is an example of part of a [[Java (programming language)|Java]] class that "inherits" from LinkedList and HashSet. See [[Method (computer programming)|Methodmethod]] for further implementation details.
<syntaxhighlight lang="Java">
public class Test implements LinkedList, HashSet {
@Override
 
// contains data members and data methods
@Override
// covariant return
//contains data members and data methods
//covariant return
 
}
</syntaxhighlight>