You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tutorials/tour/basics.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -182,9 +182,11 @@ if (point == yetAnotherPoint) {
182
182
183
183
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).
184
184
185
-
## Singleton Objects
185
+
## Objects
186
186
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.
188
190
189
191
```
190
192
object IdFactory {
@@ -197,7 +199,7 @@ object IdFactory {
197
199
}
198
200
```
199
201
200
-
You can access singleton objects just by referring its name.
202
+
You can access objects by referring its name.
201
203
202
204
```
203
205
val newId: Int = IdFactory.create()
@@ -206,7 +208,7 @@ val newerId: Int = IdFactory.create()
206
208
println(newerId) // 2
207
209
```
208
210
209
-
We will cover singleton objects in depth [later](singleton-objects.md).
211
+
We will cover objects in depth [later](singleton-objects.md).
0 commit comments