title: use of custom annotations
body: <p>I found several related (not duplicate) question to this, but they didn't satisfy me.</p>
  
  <p>I am unable to understand where and why to use <code>custom annotations</code>?</p>
  
  <p>I read an example of custom annotation in a book, but it was not explained thoroughly.</p>
  
  <pre><code>@interface MyAnno
  {
      String str();
      int val();
  }
  
  class MyClass
  {
      @MyAnno(str = "Annotation example", val = 100)
      public static void myMeth()
      {
          System.out.println("Inside myMeth()");
      }
  }
  
  class CustomAnno
  {
      public static void main(String args[])
      {
          MyClass.myMeth();
      }
  }
  </code></pre>
  
  <p>The output is as expected <code>Inside myMeth()</code>.</p>
  
  <p>I am having few questions regarding this example.</p>
  
  <blockquote>
    <p>1- How can I use <code>String str()</code> and <code>int val()</code> in this program? OR</p>
    
    <p>What is the use of any abstract method of an <code>custom annotation</code>?</p>
    
    <p>2- Why <code>custom annotations</code>. I mean that what effect they are having on any code.</p>
    
    <p>3- How can I create an annotation which is having effects like @override is having?(I mean any kind of effect which can be noticed)</p>
  </blockquote>
  
  <p>If this example is useless for you, then please give me a suitable small example in which a <code>custom annotation</code> is used.</p>