public interface IQResStack {
void push(IAbstractQueryResult a);
}
public class QResStack implements IQResStack{
public void push(AbstractQueryResult a){
}
it says it does not overide the method in interface?
Well, it doesn't. The interface defines a function that overrides a function that takes an IAbstractQueryR esult which, judging by the name, is an interface. The class however has a function taking an AbstractQueryRe sult which is a class. That won't work.
Also when overriding a method it is good practice to use the @Overrides annotation; that way the IDE you're using will tell you when something goes wrong with overriding.
So, the end result would look like this:
[code=java]public class QResStack implements IQResStack {
@Override
public void push(IAbstractQ ueryResult a) {
}
}[/code]
I see no pop() function in your code. However if you're getting that error I guess you've added the @Override annotation to it? You can only do that legally if your function is actually overriding a function from a supertype, i.e. parent class or implemented interface. And there are some limits; the signatures of the functions have to match and you can't override private or final functions and you can't override anything but methods.
Comment