title: Define an exception called "NO Match Exception" that is thrown when a string is not equal to "India"
body: <p>In the problem I have to check whether a string is equal to "India" or not. If they are not equal then I have to throw an exception "No Match Exception"</p>
  
  <p>I am creating a class nomatchexception and from constructor I am passing a string "America". Then I am checking whether it equals to "India" or not. If both are equal then printing "Matched" otherwise throwing the exception using throw.</p>
  
  <pre><code>class nomatchexception {    
      String s;
  
      nomatchexception(String s) {
          this.s = s;
  
          if (s.equals("India")) {
              System.out.print("Matched!\n");
          } else {
              throw new NoMatchException("Not Matched!\n");
          }
      }
  }
  
  class nomatchex {
      public static void main(String[] a) {
          nomatchexception v = new nomatchexception("America");
      }
  }
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>nomatchex.java:9: error: cannot find symbol
                          throw new NoMatchException("Not Matched!\n");
                                    ^
    symbol:   class NoMatchException
    location: class nomatchexception
  1 error
  </code></pre>