java - overridden method cant throw exception -


while compiling following code have got error

    @override public void routecustomerrequest (int choice) throws unsupportedcustomerrequestexception{     //throw new unsupportedoperationexception("not supported yet.");      switch(choice)     {         case '1':             system.out.println("1. add new customer");             break;         default :             throw  unsupportedcustomerrequestexception("hehehe");     } }    // constructor class  public class unsupportedcustomerrequestexception extends exception { public unsupportedcustomerrequestexception(string bong){     system.out.println(bong); } 

}

its interface is

   /*  * change template, choose tools | templates  * , open template in editor.  */ package bankingappication;  /**  *  * @author training  */ public interface ibankingservices {     public static string bankerresgistrationcode=null;      public void enquirecustomer();     public int presentservicemenu();     public void routecustomerrequest(int choice);      public boolean acceptdeposit();      public boolean acceptcheque();     public boolean processcheque();      //customer name can full or partial.     public boolean providesummarystatement(string customername);      public boolean addcustomer();     public boolean removecustomer();     public boolean updatecustomer(); }  //please debug error 

you can't declare overridden method throw broader exception.

in case exception broader no exception


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -