@@ -28,11 +28,28 @@ Constructors create instances of classes.
28
28
29
29
## Types of constructors
30
30
31
+ ### Constructor inheritance
32
+
33
+ _ Subclasses_ , or child classes, don't inherit * constructors*
34
+ from their _ superclass_ , or immediate parent class.
35
+ If a class doesn't declare a constructor, it can only use the
36
+ [ default constructor] ( #default-constructors ) .
37
+
38
+ A class can inherit the _ parameters_ of a superclass.
39
+ These are called [ super parameters] ( #super-parameters )
40
+ A subclass without constructor declarations can only use
41
+ a [ default constructor] ( #default-constructors ) .
42
+
43
+ Constructors work in a somewhat similar way to
44
+ how you call a chain of static methods.
45
+ Each subclass can call its superclass's constructor to initialize an instance,
46
+ like a subclass can call a superclass's static method.
47
+ This process doesn't involve any "inheritance".
48
+
31
49
### Default constructors
32
50
33
- If you don't declare a constructor, a default constructor is provided.
34
- The default constructor has no arguments and invokes the
35
- no-argument constructor in the superclass.
51
+ If you don't declare a constructor, Dart uses the default constructor.
52
+ The default constructor has no arguments and no name.
36
53
37
54
### Generative constructors
38
55
@@ -141,20 +158,6 @@ For example, arguments can call *static* methods
141
158
but not * instance* methods.
142
159
:::
143
160
144
- #### Constructor inheritance
145
-
146
- Subclasses don't inherit * constructors* from their superclass.
147
- Parameters of a superclass can be inherited.
148
- These are called [ super parameters] ( #super-parameters )
149
- A subclass without constructor declarations can only use
150
- a [ default constructor] ( #default-constructors ) .
151
-
152
- Constructors work in a somewhat similar way to
153
- how you call a chain of static methods.
154
- Each subclass can make a direct call its superclass's constructor to
155
- perform necessary initialization, like a subclass can make a direct to
156
- a superclass's static method. This process doesn't involve any "inheritance".
157
-
158
161
#### Super parameters
159
162
160
163
To avoid passing each parameter into the super invocation of a constructor,
0 commit comments