Unit 2: Building app UI
- The following code will
print "Divisible by 5" if number is
equal to 25.
if (number % 10 == 0) {
println("Divisible by 10")
} else if (number == 5) {
println("Divisible by 5")
}
.
false
- Which of the following
conditions are satisfied when x = 5?
Choose as many
answers as you see fit.
x == 5
Correct!
x in 1..5
Correct!
x is Int
Correct!
- Which is not a basic concept
of object-oriented programming
Readability
- Which are the four
visibility modifiers in Kotlin?
private, protected, public, internal
public, protected, static, internal
- The ___ keyword is used to
call a method from the parent class.
super
Correct!
- A(n) ___ defines properties
or methods that a class needs to implement.
Interface
- Which of the following is
best represented by a nullable type?
An optional profile
picture.
A unique ID given to
every user.
- The ___ operator allows you
to call a method only if the object is non-null.
?.
- Which is not true of
functions in Kotlin?
A function can be
changed to another data type, and vice versa.
- A function literal is another
name for a ___
Lambda expression
Function reference
Tidak ada komentar:
Posting Komentar