Тести
Мова сайту: Українська
Українська
English
Русский
Тести з програмування
Вхід
Реєстрація
Тести з програмування
Теорія
Сніпети
Статті
Головна
Android
Ціни
FAQ
Історія Cosmo
Правила та умови сервісу
Політика конфіденційності
Політика щодо файлів cookie
Зворотній Зв’язок
option
:
Мова контенту: English
Русский
What will be the result of applying fold to Option in the following code? val number: Option[Int] = Some(3) val noNumber: Option[Int] = None val result1 = number.fold(1)(_ * 3) val result2 = noNumber.fold(1)(_ * 3) println(result1) println(result2)
Option
What will be the result of applying map function to the values of type Option in the following code? val number: Option[Int] = Some(3) val noNumber: Option[Int] = None val result1 = number.map(_ * 1.5) val result2 = noNumber.map(_ * 1.5) println(result1) println(result2)
Option
What will be the result of calling method forall on empty Option? val a = None a.forall(_ == "text")
Option
What will be the result of calling method exists on empty Option? val a = None a.exists(_ == "text")
Option
What will be the result of applying function combine for options, one of which is empty? import cats.implicits._ import cats.kernel.Semigroup Semigroup[Option[Int]].combine(Option(1), None)
Option
← Попередня
1
2
Наступна →
Зареєструйся Зараз
або
Підпишись на майбутні тести