24 lines
346 B
Plaintext
24 lines
346 B
Plaintext
class T {
|
|
public function print {
|
|
println ("class T")
|
|
}
|
|
}
|
|
|
|
class S extends T {
|
|
public function print {
|
|
println ("class S")
|
|
}
|
|
}
|
|
|
|
var t = new T()
|
|
var s = new S()
|
|
println ("before copy")
|
|
t.print()
|
|
s.print()
|
|
|
|
var tcopy = clone (t, false)
|
|
var scopy = clone (s, false)
|
|
println ("after copy")
|
|
tcopy.print()
|
|
scopy.print()
|