java - Does removing the "final" keyword affect binary compatibility? -


if remove final keyword method or other "thing", users of class have recompile?

technically, won't have recompile.

i cannot think of repercussions can result removing final keyword method / attribute may lead loss in compatibility should not give problems.

tested sample code , there no runtime errors:

public class test2{     public static final string test = "hello!"; }  public class test {     public static void main (string [] args) {         system.out.println(test2.test);     } } 
  1. compiled test.java
  2. ran test.java -> output = "hello!"
  3. modified test2.java:

    public class test2{     public static string test = "hello!"; } 
  4. compiled test2.java

  5. ran test.java -> output = "hello!"

Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -