Are there any specific examples of backward incompatibilities between Java versions?

后端 未结 14 734
孤城傲影
孤城傲影 2020-12-02 12:28

Have there been incompatibilities between Java releases where Java source code/Java class files targeting Java version X won\'t compile/run under version Y (where Y > X) ?

14条回答
  •  无人及你
    2020-12-02 13:00

    The main one that I can think of is the introduction of new reserved words:

    Java 1.3: strictfp
    Java 1.4: assert
    Java 5.0: enum
    

    Any code that previously used these values as identifiers would not compile under a later version.

    One other issue that I remember causing problems on a project that I worked on was that there was a change in the default visibility of JInternalFrames between 1.2 and 1.3. They were visible by default, but when we upgraded to 1.3 they all seemed to have disappeared.

提交回复
热议问题