equal
deleted
inserted
replaced
27 * @summary Cloning a subclass of LinkedList results in an object that isn't |
27 * @summary Cloning a subclass of LinkedList results in an object that isn't |
28 * an instance of the subclass. The same applies to TreeSet and |
28 * an instance of the subclass. The same applies to TreeSet and |
29 * TreeMap. |
29 * TreeMap. |
30 */ |
30 */ |
31 |
31 |
32 import java.util.*; |
32 import java.util.LinkedList; |
|
33 import java.util.TreeMap; |
|
34 import java.util.TreeSet; |
33 |
35 |
34 public class Clone { |
36 public class Clone { |
35 public static void main(String[] args) { |
37 public static void main(String[] args) { |
36 LinkedList2 l = new LinkedList2(); |
38 LinkedList2 l = new LinkedList2(); |
37 LinkedList2 lClone = (LinkedList2) l.clone(); |
39 LinkedList2 lClone = (LinkedList2) l.clone(); |