title: Throwing multiple exceptions in a method of an interface in java
body: <p>I wanted to ask that how to mention this in my interface </p>
  
  <pre><code>public class find(int x) throws A_Exception, B_Exception{
  ----
  ----
  ---
  }
  </code></pre>
  
  <p>i want to say that i can mention One exception in an interface but how to mention in my interface that my method will throw Two exceptions Namely A and B...</p>
  
  <p>the code fragment mentioned above works only for A and not for B... Help</p>
  
  <pre><code>public interface dictionary{ 
     public void insert(int x) throws Dictionary_FullException, Duplicate_Element_FoundException; 
  }
  ...
   public class SortedArray implements dictionary{ 
     public void insert(int x) throws Dictionary_FullException, Duplicate_Element_FoundException {
   ---------
  }
  </code></pre>
  
  <p>but when i compile it ... it says..</p>
  
  <blockquote>
    <p>SortedArray.java:66: insert(int) in
    assign.SortedArray cannot implement
    insert(int) in assign.dictionary;
    overridden method does not throw
    assign.SortedArray.Duplicate_Element_FoundException public
    void insert(int x) throws
    Dictionary_FullException</p>
  </blockquote>