Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1c1f1ec

Browse files
committed
Rename singleton objects to objects
1 parent c14cab8 commit 1c1f1ec

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tutorials/tour/basics.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,11 @@ if (point == yetAnotherPoint) {
182182

183183
There is a lot more to case classes that we'd like to introduce, and we are convinced you will fall in love with it! We will cover them in depth [later](case-classes.md).
184184

185-
## Singleton Objects
185+
## Objects
186186

187-
You can define singleton objects with `object` keyword.
187+
Objects are single instances of its own definition. You can think of them as singletons of their own classes.
188+
189+
You can define objects with the `object` keyword.
188190

189191
```
190192
object IdFactory {
@@ -197,7 +199,7 @@ object IdFactory {
197199
}
198200
```
199201

200-
You can access singleton objects just by referring its name.
202+
You can access objects by referring its name.
201203

202204
```
203205
val newId: Int = IdFactory.create()
@@ -206,7 +208,7 @@ val newerId: Int = IdFactory.create()
206208
println(newerId) // 2
207209
```
208210

209-
We will cover singleton objects in depth [later](singleton-objects.md).
211+
We will cover objects in depth [later](singleton-objects.md).
210212

211213
## Traits
212214

0 commit comments

Comments
 (0)