Polymorphic copy: Difference between revisions

m
Line 682:
</lang>
=={{header|Elena}}==
ELENA 3.4.x :
<lang elena>import extensions.;
class T
{
Name = "T".;
T<T> clone() = new T new.();
}
class S :: T
{
Name = "S".;
T<T> clone() = S new. S();
}
public program()
{
[
T<T> original := S new. S();
T<T> clone := original .clone.();
console .printLine(original .Name).;
console .printLine(clone .Name).
]}</lang>
{{out}}
<pre>
Anonymous user