`

why List hasn't clone method but the ArrayList has

 
阅读更多
List list = new ArrayList();
 

for this list, it hasn't the clone method

 

ArrayList arraylist = new ArrayList();

 

but this arraylist does have clone, why?

 

first, List is an interface, it does not extend Object which has the clone method internally

second, list object does not have the method which exists in the List interface's implementation class ArrayList though.

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics