Exceptions and inheritance
Hi all,
I need some help to solve a design problem ( I suppose !).
I磛e created an Interface declaring methods that throws an Exception and created an Adapter implementing my Interface.
I thought that when I write a class that extends my Adapter it would force to write the method signature with the throws declaration, what it doesn磘.
Well, what I want is when someone write a class, it should extends/implements my Adapter/Interface and the overridden method should have the throws declaration.
I don磘 know if I was clear, but if so, is there any way to implement this design ?
Here is how is my classes:
publicinterface MyInterface{
publicboolean MyMethod(Object o)throws MyException ;
}
publicabstractclass MyAdapterimplements MyInterface{
publicboolean MyMethod(Object o)throws MyException{
returnfalse;
}
}
publicclass MyClassextends MyAdapter{
publicboolean MyMethod(Object o){
returnfalse;
}
}
I磀 like to force MyMethod at MyClass to throw MyException !
Thank you

