If you have a class with a public method
public class Foo {
public void method() {}
}
This method is available and therefore you can
Foo foo = new Foo();
foo.method();
If you add a subclass
public class Bar extends Foo {
@Override
public void method() {}
}
If it was private, you cannot perform
Foo bar = new Bar();
bar.method();
In this example, a Baris Foo, so it should be able to replace Foowherever expected.
, . . ( .)