Duplicate methods named spliterator with the parameters () and () are inherited from the types Colle

Duplicate methods named spliterator with the parameters () and () are inherited from the types Collection> and Iterable>


static class  EntrySet
    extends AbstractSet> {
      private int size;
      EntrySet(int size) {
        if(size < 0)
          this.size = 0;
        // Can't be any bigger than the array:
        else if(size > DATA.length)
          this.size = DATA.length;
        else
          this.size = size;
      }
      public int size() { return size; }
      private class Iter
      implements Iterator> {
        // Only one Entry object per Iterator:
        private Entry entry = new Entry(-1);
        public boolean hasNext() {
          return entry.index < size - 1;
        }
        public Map.Entry next() {
          entry.index++;
          return entry;
        }
        public void remove() {
          throw new UnsupportedOperationException();
        }
      }
      public
      Iterator> iterator() {
        return new Iter();
      }
    }

显示错误Duplicate methods named spliterator with the parameters () and () are inherited from the types Collection> and Iterable>

在类EntrySet类中添加下面方法就行了。    

 public Spliterator> spliterator() {
  return null;
  }

你可能感兴趣的:(java)