如何限定继承类

IndexReader() {
    if (!(this instanceof CompositeReader || this instanceof AtomicReader))
      throw new Error("IndexReader should never be directly extended, subclass AtomicReader or CompositeReader instead.");
  }


你可能感兴趣的:(如何限定继承类)