|
The Java Language Specification
The Java programming language has evolved since the publication of the The Java Language Specification. Here is a brief overview of changes made to the Java platform in JDK 1.1(Originally published as Appendix D from The Java Programming Language by Ken Arnold). The most significant language change has been:
Please send us any technical remarks. We look forward to your comments. Package Naming ConventionsJLS 7.7 discusses recommended conventions for package names and states that the first component of a unique package name should be written in uppercase letters. This is no longer the recommended convention. The relevant text should be revised to state:The first component of a unique package name is always written in all-lowercase ASCII letters and should be one of the top-level domain names, currently com, edu, gov, mil, net, org, or one of the English two-letter codes identifying countries as specified in ISO Standard 3166, 1981.
Method OverrideThe specification of when a method of a subclass overrides a method in a superclass given in JLS 8.4.6.1 is revised to state:An instance method m declared in class C overrides another method m' declared in class C' if and only if the following three conditions hold:Here is a rationale for the change. Interface Member ModifiersSeveral grammar productions were inadvertently omitted from section 9.3 of the JLS, which discusses modifiers on members of interfaces. The beginning of JLS 9.3 should be corrected to read:Every field declaration in the body of an interface is implicitly public,static, and final. It is permitted, but strongly discouraged as a matter of style, to redundantly specify any or all of these modifiers for such fields. It is a compile time error if the same modifier appears more than once in a field declaration. Arrays implement java.io.SerializableJLS 10.7 (p. 198) should be amended to state that all arrays implement the interface java.io.Serializable, in addition to the interface Cloneable.
Preparation does not cause AbstractMethodErrorsJLS 12.3.2 should be amended so that AbstractMethodError is not thrown during preparation. The revised section text is:Preparation involves creating the static fields (class variables and constants) for a class or interface and initializing such fields to the standard default values (§4.5.4). This does not require the execution of any Java code; explicit initializers for static fields are executed as part of initialization (§12.4), not preparation. Resolution of Symbolic ReferencesIn JLS 12.3.3 the bullets discussing NoSuchFieldError and NoSuchMethodError should be amended by omitting the restriction that the declaration of the field or method must be local to class and may not be an inherited field or method.Class InitializationJLS 12.4.1 should be modified to clarify exactly when class initialization may be initiated. The initial paragraph of JLS 12.4.1 can be restated as follows:Initialization of a class consists of executing its static initializers and the initializers for static fields declared in the class. Initialization of an interface consists of executing the initializers for fields declared in the interface. Class finalizationClass finalization (JLS 12.7) has been removed from the Java language. The functionality of JLS 12.7 is subsumed by instance finalization (JLS 12.6). Here is a rationale for this decision.Class UnloadingQuestions have arisen with respect to the interpretation of JLS 12.8 "Unloading of Classes and Interfaces". The following statement should help clarify the issue:A class or interface may be unloaded if and only if its class loader is unreachable (the definition of unreachable is given in JLS 12.6.1). Classes loaded by the bootstrap loader may not be unloaded. Here is a brief technical
rationale for this statement.
Compilation of Symbolic ReferencesNote: this change only applies to compilers targeted at virtual machines that perform a resolution time lookup (see changes to 12.3.3 above). These include the JDK1.1 and 1.2 VMs (but not the JDK1.0.2 VM), and any virtual machine whose version number is 46.0 and above.The third bullet of JLS 13.1 should be corrected to state the following: Given a legal field access expression in a class C referencing a field f declared in another class:Similarly, the fourth bullet of JLS 13.1 should be corrected as follows: Given a method invocation expression in a class C referencing a method m declared in another class:Here is an explanation why these corrections are necessary. Obviously, much of JLS 13.4.5 must change in light of the changes to JLS 13.1 and 12.3.3. Final Fields and Binary CompatibilityIn JLS 13.4.8, the first lines of page 251 should be corrected to read:Suppose that a new version of class Super is produced: Volatile Fields and Binary CompatibilityJLS 13.4.11 erroneously states that changing a (non-private) field from volatile to non-volatile or vice versa may cause an IncompatibleClassChangeError. This is untrue, and section 13.4.11 should be disregarded.Corrrected Method Lookup AlgorithmThe method lookup algorithm given in JLS 15.11.4.4 is inaccurate. Here is a reformulation of the algorithm that reflects the semantics given in the rest of the book:The dynamic method lookup uses the following procedure to search class S, and then the superclasses of class S, as necessary, for method m. null is a Compile time ConstantJLS 15.27 defines the notion of a compile time constant. The definition erroneously excludes null. The beginning of JLS 15.27 should read:A compile-time constant expression is an expression denoting a value of primitive type or null or a String that is composed using only the following:
| ||||||
Oracle is reviewing the Sun product roadmap and will provide guidance to customers in accordance with Oracle's standard product communication policies. Any resulting features and timing of release of such features as determined by Oracle's review of roadmaps, are at the sole discretion of Oracle. All product roadmap information, whether communicated by Sun Microsystems or by Oracle, does not represent a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. It is intended for information purposes only, and may not be incorporated into any contract.
|
| ||||||||||||