If I remove the final
keyword from a method or other "thing", will users of my class have to recompile?
Does removing the "final" keyword affect binary compatibility?
204 Views Asked by Nova AtThere are 4 best solutions below

No, removing the final keyword will not break compatibility assuming you're fine with this wart:
If module B calls any method from a class in module A and module C overrode the previously final method, and an object from module C is passed to module B, the call will go to module A's implementation.

No if your clients call your code directly. But is might break a program that discovers your class using reflection, checks whether your method is final and does different things if method is final or not.

Straight from the horse's mouth:
Changing a method that is declared final to no longer be declared final does not break compatibility with pre-existing binaries.
http://docs.oracle.com/javase/specs/jls/se7/html/jls-13.html#jls-13.4.17
Technically, they won't have to recompile.
I cannot think of any repercussions that can result from removing the final keyword from a method / attribute which may lead to loss in compatibility so it should not give you any problems.
Tested with sample code and there were no runtime errors:
Modified Test2.java:
Compiled Test2.java