Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

Changes between Version 1 and Version 2 of class_init

Show
Ignore:
Author:
keinfarbton (IP: 217.228.165.88)
Timestamp:
10/20/06 10:22:36 (18 years ago)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • class_init

    v1 v2  
    11= Refactoring of field initializers, instance initializers and static constructors = 
    22 
    3  # In Java a class can have multiple instance initializers and class initializers. In D there are no instance initializer and only one static ctor is allowed. 
    4  # In Java a field can be initialized in its declaration. The initialization can also include nearly every expression. In D an initializer must be a compile time module-local constant value. 
     3 1. In Java a class can have multiple instance initializers and class initializers. In D there are no instance initializer and only one static ctor is allowed. 
     4 2. In Java a field can be initialized in its declaration. The initialization can also include nearly every expression. In D an initializer must be a compile time module-local constant value. 
    55 
    66== Static ctors and initialization of static fields ==