Quiz
- Which answer best describes Kotlin?
a) It's a statically typed functional programming language with some OOP features b) It's a statically typed OOP language with some functional programming features c) It's a dynamically typed functional programming language with some OOP features d) It's a dynamically typed OOP language with some functional programming features
- Does Kotlin allow us to inherit multiple parent classes?
a) Yes, a class in Kotlin can extend any number of classes
b) No, a class in Kotlin can extend only up to one other class
- When not explicitly specifying a superclass when declaring a class, what will be its superclass?
a) It will have no super class
b) java.lang.Object
c) kotlin.Object
d) kotlin.Any
- Will this code run in the Kotlin REPL; if not, why?
var k: Int = null
a) Yes, this will run without errors
b) No, an error will occur because Kotlin's type system will not allow null
values for the Int
type
c) No, a mutable variable defined with var
can never be initialized with...