Skip to content

Commit 476a35e

Browse files
Geek-Joesarahhaggarty
authored andcommitted
Update kotlin-tour-intermediate-open-special-classes.md
call to the constructor
1 parent 97aaf9e commit 476a35e

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

docs/topics/tour/kotlin-tour-intermediate-open-special-classes.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,11 @@ If you can't use interfaces or abstract classes, you can explicitly make a class
2323
To do this, use the `open` keyword before your class declaration:
2424

2525
```kotlin
26-
open class Vehicle
26+
open class Vehicle(val make: String, val model: String)
2727
```
2828

2929
To create a class that inherits from another, add a colon after your class header followed by a call to the constructor
30-
of the parent class that you want to inherit from:
31-
32-
```kotlin
33-
class Car : Vehicle
34-
```
35-
{validate="false"}
36-
37-
In this example, the `Car` class inherits from the `Vehicle` class:
30+
of the parent class that you want to inherit from. In this example, the `Car` class inherits from the `Vehicle` class:
3831

3932
```kotlin
4033
open class Vehicle(val make: String, val model: String)
@@ -572,4 +565,4 @@ fun main() {
572565

573566
## Next step
574567

575-
[Intermediate: Properties](kotlin-tour-intermediate-properties.md)
568+
[Intermediate: Properties](kotlin-tour-intermediate-properties.md)

0 commit comments

Comments
 (0)