Reputation: 258
I'm trying to set a certain value, monsterHealth
, to display 0
instead of a negative number. If I'm trying to reassign the value to show 0
instead of, say, -2
, would I want to use =
or ==
?
Upvotes: 1
Views: 79
Reputation: 5853
Those are different operators:
=
- assignment operator,==
and !=
- equality operators,===
and !==
- referential equality operators.also
val
- read only variable/property (it cannot be reassigned/changed),var
- mutable variable/property.Kotlin Documentation - Keywords and operators
Upvotes: 1