Given the following definition
def loop: Boolean = loop
which options will result in an infinite loop?
The def form is "by-name", its right hand side is evaluated on each use. The is also a val form, which is "by-value" The right-hand side of val definition is evaluated at the point of the definition itself. Afterwards, the name refers to the value.
Source: Conditionals and Value Definitions

Слідкуй за CodeGalaxy

Мобільний додаток Beta

Get it on Google Play
Зворотній Зв’язок
Продовжуйте вивчати
тести з Scala
Зареєструйся Зараз
або Підпишись на майбутні тести