As since in a class I can do:
public final class Foo{}
wich means no more classes can extends that Foo
class... e.g. String
class is final, so no custom class can extends the class String
.
How can I prevent to do the same with an interface?
If I do
public interface ISome{
void fly();
}
I would like to allow that
class A implements ISome {}
but block that
public interface IHouse extends ISome{
void fly();
}
doing this
public final interface ISome{}
makes no sense... and will bring a compile error like:
Illegal modifier for the interface