The original question was not clear, so it was closed.
Java Interface - Fatal Flaw
Suppose we have an interface A, being implemented by class B. If programmers consistently use type A every time an instance of B is referred to, then any method, say m, defined in B but not specified in A is hidden and cannot be accessed by any code holding a reference of type A. There is a fatal flaw in this argument. How can a piece of code referring to an instance of B (with type A) can in fact access m ??
It's obvious that the OP has some sort of misunderstanding, but it's not clear what it is. Do they think that all classes of type
B must be referred to with variables of type
A? Or do they think interfaces are required to declare every method in every class that implements the interface? Something else?
Your edit improves the question, but are you sure you guessed the OP's intention right?