class Cons extends LinkedList { int elem; LinkedList next; LinkedList copy(){ Cons res = new Cons(); res.elem = this.elem; res.next = this.next.copy(); return res; } }
class Cons extends LinkedList { int elem; LinkedList next; LinkedList copy(){ Cons res = new Cons(); res.elem = this.elem; res.next = this.next.copy(); return res; } }