Skip to content

Update comment in example code #2500

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions _tour/classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Constructors can have optional parameters by providing a default value like so:
class Point(var x: Int = 0, var y: Int = 0)

val origin = new Point // x and y are both set to 0
val point1 = new Point(1) // y is set to 0
val point1 = new Point(1) // x is set to 1 and y is set to 0
println(point1) // prints (1, 0)
```
{% endtab %}
Expand All @@ -111,7 +111,7 @@ println(point1) // prints (1, 0)
class Point(var x: Int = 0, var y: Int = 0)

val origin = Point() // x and y are both set to 0
val point1 = Point(1) // y is set to 0
val point1 = Point(1) // x is set to 1 and y is set to 0
println(point1) // prints (1, 0)
```
{% endtab %}
Expand Down