Yes it is acceptable, in as much as the compiler stores calls to the other class as method name plus signature: parameter types, again as text.
I have even seen following horror
interface A {
final A = new B();
}
class B implements A {
}
Java is loosely bound; there are corresponding runtime exceptions thrown.
The same is compiling against another version of a library jar, and running with a jar with broken API.