Method override of an interface

Asked

Viewed 103 times

1

I’m having a question about the method override of an interface. I can override a method in a daughter class that inherits from the mother class the implementation of an interface and in that method use receiving parameters?

Interface:

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

Mother Class:

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

Classe Filha:

public class Titulo extends Conta{
    public double getValorAPagar(int param1, int param2){
       // implementação.
    }
}

1 answer

2


It cannot because they are completely different methods. It is only the same method if the signing is exactly the same and can only overwrite the same method.

  • I understand. Thank you very much.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.