mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 09:41:36 +00:00
Update kotlin.html.markdown
This commit is contained in:
parent
5db57517d6
commit
2ff50ccd2c
@ -426,7 +426,7 @@ data class Counter(var value: Int) {
|
||||
operator fun invoke() = println("The value of the counter is $value")
|
||||
|
||||
}
|
||||
/* You can also overload operators through an extension methods */
|
||||
/* You can also overload operators through extension methods */
|
||||
// overload -Counter
|
||||
operator fun Counter.unaryMinus() = Counter(-this.value)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user