Skip to content

Commit 6f0ee04

Browse files
Abstract class subsubsection -> class inheritance modifiers
1 parent ae7e469 commit 6f0ee04

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Diff for: docs/src/md/kotlin.core/declarations.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -386,12 +386,14 @@ Due to the [initialization order of a classifier object][Classifier initializati
386386
> // but d1 methods are still delegated to x1
387387
> ```
388388
389-
##### Abstract classes {#abstract-classes-declarations}
390389
391-
A [class declaration][Class declaration] can be marked `abstract`.
392-
Such classes *cannot* be instantiated directly; they are used as superclasses for other classes or objects.
390+
##### Class inheritance modifiers
393391
394-
Abstract classes may contain one or more abstract members: members without implementation, which should be implemented in a subtype of this abstract class.
392+
Class inheritance behaviour can be changed using modifiers, such as `open`, [`abstract`][Abstract classes] and [`sealed`][Sealed classes and interfaces].
393+
394+
- Modifier `open` allows for a class to be inherited from. By default classes are [closed][Classifier type inheritance] (that is, they cannot be inherited from), one should add this modifier to change the behaviour.
395+
- Modifier [`abstract`][Abstract classes] allows for a class to have members without implementation (that is, *abstract members*). Such classes *cannot* be instantiated directly; they are used as superclasses for other classes or objects. Abstract members must be implemented in a non-abstract subtype of this abstract class.
396+
- Modifier [`sealed`][Sealed classes and interfaces] works similarly to the `abstract` modifier, but for *sealed* classes inheritance is limited to the module it was defined in.
395397
396398
#### Data class declaration
397399

0 commit comments

Comments
 (0)