As in the class, I can do:
public final class Foo{}
which means that no classes can extend this class Foo... for example. Stringthe class is final, so a custom class cannot extend the class String.
How can I prevent doing the same with the interface?
If i do
public interface ISome{
void fly();
}
I would like this
class A implements ISome {}
but block that
public interface IHouse extends ISome{
void fly();
}
doing it
public final interface ISome{}
does not make sense ... and will result in a compilation error, for example:
Illegal modifier for the interface
source
share