而且像这样的设计在java类库中还不少见,听别人说这样做只是为了代码规范,看了方便,一看就知道实现了List接口,不然得跳到父类才知道。但总感觉这样做似乎还有别的用意。 以下为截取的头部,详情可以看源码。 public abstract class AbstractList extends AbstractCollection implements List { public class ArrayList extends AbstractList implemen
在坐的各位,看看写这个源代码的大师是怎么解释的?stackoverflow里面的答案
解释:I've asked Josh Bloch, and he informs me that it was a mistake. He used to think, long ago, that there was some value in it, but he since "saw the light". Clearly JDK maintainers haven't considered this to be worth backing out later.
这是链接:http://stackoverflow.com/questions/2165204/why-does-linkedhashsete-extend-hashsete-and-implement-sete