Cloning with generics

后端 未结 6 594
栀梦
栀梦 2020-12-08 17:19

Once upon a time there was a class:

public class Scope> implements Comparable>, Clon         


        
6条回答
  •  萌比男神i
    2020-12-08 17:38

    As a general comment, avoid using Object.clone() whenever possible. If you have control over the code in question, implement a copy constructor instead. See here for information.

提交回复
热议问题