Skip to content

Commit 5440ef3

Browse files
author
Tony Sansone
committed
Clarified for #5227
1 parent a13bf5c commit 5440ef3

File tree

1 file changed

+20
-17
lines changed

1 file changed

+20
-17
lines changed

src/content/language/constructors.md

+20-17
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,28 @@ Constructors create instances of classes.
2828

2929
## Types of constructors
3030

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+
3149
### Default constructors
3250

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.
3653

3754
### Generative constructors
3855

@@ -141,20 +158,6 @@ For example, arguments can call *static* methods
141158
but not *instance* methods.
142159
:::
143160

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-
158161
#### Super parameters
159162

160163
To avoid passing each parameter into the super invocation of a constructor,

0 commit comments

Comments
 (0)