I have a Java interface in an API that contains a single method:
public interface MyInterface
{
public void foo();
}
If I add a method to that interface like this:
public interface MyInterface
{
public void foo();
public void bar();
}
Do clients using the API need to recompile or can they use the new JAR as is because I didn’t change the signature or an existing method or remove a method?
Short answer: The can use the new API without recompiling.
Here’s a LINK that might help you understand how Java runs bytecode and how it does dynamic linking.