title: Throw an exception from an overridden method of a Java class
body: <p>I want to extend Java's <code>HashMap&lt;K, V&gt;</code> class. I override the <code>put(...)</code> method and I want to throw an exception in some cases.</p>
  
  <p>Since the base class's <code>put</code> method doesn't throw an exception, I get a compiler error.</p>
  
  <p>What is the best solution for this?</p>
  
  <p>Thanks!</p>