Overwriting methods of an interface

1

I'm having a question about overwriting methods of an interface. Can I override a method in a child class that inherits from the parent class the implementation of an interface and in that method use receive parameters?

Interface:

public interface Pagavel {
    public abstract double getValorAPagar();
}

Mother Class:

public abstract class Conta implements Pagavel {
    public abstract double getValorAPagar();
}

Daughter Class:

public class Titulo extends Conta{
    public double getValorAPagar(int param1, int param2){
       // implementação.
    }
}
    
asked by anonymous 24.10.2017 / 00:57

1 answer

2

You can not because they are completely different methods. It is only the same method if signature is exactly the same and can only overwrite the same method.

    
24.10.2017 / 01:04