title: Should I use throws while using throw?
body: <p>My method has a return type that throws <code>NullPointerException</code>. </p>
  
  <pre><code>public class Student {
      public String studentOne() {    
          //code to get name
          if(name == null)
              throw new NullPointerException("Error");
          else
              return name; 
      }
  }
  </code></pre>
  
  <p>my question is .. Should I use <code>public String studentOne throws NullPointerException</code>while throwing new exception?</p>
  
  <p>P.S : I know its not bestpractice to throw <code>nullPointerException</code>. But its required in my project</p>