> Documentation index: https://developer.android.com/courses/llms.txt

# Kotlin fundamentals

<br />


Return to pathway
1.

   ## 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")
   }
   ```
   `true` `false`
2.

   ## Which of the following conditions are satisfied when `x = 5`?


   Choose as many answers as you see fit.
   `x == 5` `x in 1..5` `x is Int` `x % 5 `
3.

   ## Which is not a basic concept of object-oriented programming

   Abstraction Readability Inheritance Polymorphism
4.

   ## Which are the four visibility modifiers in Kotlin?

   `public`, `private`, `protected`, `abstract` `static`, `override`, `internal`, `external` `private`, `protected`, `public`, `internal` `public`, `protected`, `static`, `internal`
5.

   ## The ___ keyword is used to call a method from the parent class.

   `this` `super` `parent` `self`
6.

   ## A(n) ___ defines properties or methods that a class needs to implement.

   Delegate Generic type Interface Subclass
7.

   ## Which of the following is best represented by a nullable type?

   The number of followers (0 or more) in a social media app. An optional profile picture. A username that must be at least one character. A unique ID given to every user.
8.

   ## The ___ operator allows you to call a method only if the object is non-null.

   `.` `!!` `?:` `?.`
9.

   ## Which is not true of functions in Kotlin?

   A function can be changed to another data type, and vice versa. A function can be returned from another function. A function can take another function as a parameter. A function has a data type, such as `(Int) -> Unit`.
10.

    ## A function literal is another name for a ___

    Function type Lambda expression Function reference Trailing lambda

<button class="button-primary devsite-quiz-submit-button" type="submit"> Submit answers </button>


*error_outline* An error occurred when grading the quiz. Please try again.