tasks a-s

This commit is contained in:
Ingy döt Net 2013-04-10 23:57:08 -07:00
parent 47bf37c096
commit b83f433714
12433 changed files with 156208 additions and 123 deletions

View file

@ -0,0 +1,38 @@
/* NetRexx */
options replace format comments java crossref savelog symbols binary
-- -----------------------------------------------------------------------------
class RCPolymorphicCopy public
method copier(x = T) public static returns T
return x.copy
method main(args = String[]) public constant
obj1 = T()
obj2 = S()
System.out.println(copier(obj1).name) -- prints "T"
System.out.println(copier(obj2).name) -- prints "S"
return
-- -----------------------------------------------------------------------------
class RCPolymorphicCopy.T public implements Cloneable
method name returns String
return T.class.getSimpleName
method copy public returns T
dup = T
do
dup = T super.clone
catch ex = CloneNotSupportedException
ex.printStackTrace
end
return dup
-- -----------------------------------------------------------------------------
class RCPolymorphicCopy.S public extends RCPolymorphicCopy.T
method name returns String
return S.class.getSimpleName