Q261
Open questionval arr = arrayof(1, 2, 3)Select an option to see the answer and solution.
Practice every MCQ with options. Use Show answers when you want the correct option and solution.
292
Questions
14/15
Page
Pick an option on a question to see the right answer and solution.
Q261
Open questionval arr = arrayof(1, 2, 3)Select an option to see the answer and solution.
Q262
Open questionopen class Employee(){
open fun display() = println("Employee display()")
}
class Supervisor : Employee() {
override fun display() {
println("Supervisor display()")
}
}Select an option to see the answer and solution.
Q263
Open questionvar ndx = 0;
for (value in 1..5){
println("value")
ndx++
}Select an option to see the answer and solution.
Q264
Open questionfirstName?.let {
println("Greeting $firstname!")
}Select an option to see the answer and solution.
Q265
Open questionint x = a ? b : c Select an option to see the answer and solution.
Q266
Open questionenum class Signal { OPEN, CLOSED, SENDING }Select an option to see the answer and solution.
Q267
Open questionval list : List<Int> = listof(1, 2, 3)
list.add(4)
print(list)Select an option to see the answer and solution.
Q268
Open questionval listA = mutableListOf(1, 2, 3)
val listB = listA.add(4)
print(listB)Select an option to see the answer and solution.
Q269
Open questionclass Record{
companion object {
const val COLOR = "Red"
val SIZE = "Large"
}
}Select an option to see the answer and solution.
Q270
Open questionval list2 = (80..100).toList().filter(_____)Select an option to see the answer and solution.
Q271
Open questionvar a: String? = "KotlinProgramming"
var b: String = 'KotlinProgramming"Select an option to see the answer and solution.
Q272
Open questionclass Person (val name: String)Select an option to see the answer and solution.
Q273
Open questionsealed class Status(){
object Error : Status()
class Success : Status()
}
fun main(){
var successStatus = Status.Success()
var errorStatus = Status.Error()
}Select an option to see the answer and solution.
Q274
Open questionval seq = sequence { yieldAll(1..20) }
.filter { it < 11 }
println(seq)Select an option to see the answer and solution.
Q275
Open questionfun main() { val highScores = listOf(4000, 2000, 10200, 12000, 9030)}Select an option to see the answer and solution.
Q276
Open questionclass PersonSelect an option to see the answer and solution.
Q277
Open questionfor(y in 1..100) y+=2Select an option to see the answer and solution.
Q278
Open questionclass Detail {
companion object {
const val COLOR = "Blue"
@JvmField val SIZE = "Really Big"
}
}Select an option to see the answer and solution.
Q279
Open questionval a = arrayOf(1, 2, 3) val b = arrayOf(100, 200, 3000)Select an option to see the answer and solution.
Q280
Open questionabstract class Aircraft {
init { println("Aircraft = ${getName()}") }
abstract fun getName(): String
}
class Airplane(private val name: String) : Aircraft() {
override fun getName(): String = name
}Select an option to see the answer and solution.