Kotlin Program - Study Mode
[#196] In the file main.kt, you ae filtering a list of integers and want to use an already existing function, removeBadValues. What is the proper way to invoke the function from filter in the line below? val list2 = (80..100).toList().filter(_____)
Correct Answer
(A) ::removeBadValues
[#197] What does the !! operator do?
Correct Answer
(A) It converts any value to a non-null type and throws anexception if the value is in fact null
[#198] What is the syntax for calling a method in Kotlin?
Correct Answer
(A) object.method()
[#199] What is the correct way to define a primary constructor in Kotlin?
Correct Answer
(D) class Person()
[#200] Does Kotlin have primitive data types, such as int, long, float?
Correct Answer
(A) No, not at language level. But the Kotlin compiler makes use of JVM primitives for best performance