I want to declare a method in an interface where the parameter of the method defined in implementing classes can be a subtype of a specific java class for example:
interface Processor{
processRequest( Request r);
}
public class SpecialRequest extends Request{...}
public class SpecialProcessor implements Processor{
processRequest(SpecialRequest r){...}
}
but I get errors in the SpecialProcessor because it doesn't properly implement the Processor interface. What can I change in the Processor interface to allow the definition in the SpecialProcessor to work?