title: Marker Annotation vs Marker Interface
body: <p>While reading about Marker interfaces I stumbled upon the following site : <a href="http://jtechies.blogspot.in/2012/07/item-37-use-marker-interfaces-to-define.html" rel="noreferrer">Item 37: Use marker interfaces to define types</a>
  <br>
  Here, according to Joshua Bloch there are two advantages of Marker interfaces over the Marker annotations.</p>
  
  <blockquote>
    <ol>
    <li><p>Marker interfaces define a type that is implemented by instances of
    the marked class; marker annotations do not. The existence of this
    type allows you to catch errors at compile time that you couldn’t
    catch until runtime if you used a marker annotation.</p></li>
    <li><p>Another advantage of marker interfaces over marker annotations is
    that they can be targeted more precisely. If an annotation type is
    declared with target <code>ElementType.TYPE</code>, it can be applied to any
    class or interface. Suppose you have a marker that is applicable
    only to implementations of a particular interface. If you define it
    as a marker interface, you can have it extend the sole interface to
    which it is applicable, guaranteeing that all marked types are also
    subtypes of the sole interface to which it is applicable.</p></li>
    </ol>
  </blockquote>
  
  <p>OK, First point is understood but I'm not sure if I understand the 2nd point correctly:</p>
  
  <blockquote>
    <p>If an annotation type is declared with target <code>ElementType.TYPE</code>, it can be applied to any class or interface. </p>
  </blockquote>
  
  <p>Likewise, if I have a marker interface then that too can be applied to any class or interface. Isn't it saying the same thing about marker annotations and marker interfaces? <strong>How can a marker interface be targeted more precisely?</strong></p>
  
  <p>The 2nd point also mentions that:</p>
  
  <blockquote>
    <p>you can have [the Marker Interface] extend the sole interface to which it is applicable, guaranteeing that all marked types are also subtypes of the sole interface to which it is applicable. </p>
  </blockquote>
  
  <p><strong>Can't you also achieve this with annotations, by using the <code>@Inherited</code> meta-annotation</strong>?</p>