3
I am rewriting the code of an application seeking the best use of interfaces and I came across a problem:
I have a class that needs to have a private method and I want to create an interface for it, because I have other classes that do the same function.
In short: how do I create an interface that implements a class in this way:
public class Classe implements Interface{
@Override
public metodoPublico (){
...
}
@Override
private metodoPrivado (){
...
}
}
Have you ever thought about using the "protected" access modifier instead of "private"? because who can implement or see such methods is only who inherits it.
– Lucas Fantacucci