31 Oktober 2022

Android Basics with Compose

Interact with UI and state

 

1.      Jetpack Compose runs your composables for the first time, during ___ it will keep track of the composables that you call to describe your UI.

2.      The only way to modify a Composition is through recomposition.

Correct!

3.      ___ is when Jetpack Compose re-executes the composables that may have changed in response to data changes.

Correct!

4.      ___ in an application is any value that can change over time.

5.      ___ is a pattern of moving state up to make a component stateless.

6.      Which KeyboardAction property is used to move the focus to the next composable?

7.      Which of the following Kotlin functions is used to round up a Double or Float?

30 Oktober 2022

Android Basics with Compose

 

More Kotlin fundamentals

1.      Which of the following is a valid way to define a data class in Kotlin?

2.      When using a sealed class, all direct subclasses must be in the same package.

Correct!

3.      When using generics, the generic data type goes inside ___.

4.     

A(n) ___ class is useful when you have a fixed set of values.

Correct!

5.      To create a list object that has the ability to change its size, you would call ___.

Correct!

6.     

Which of the following are higher-order functions?

Choose as many answers as you see fit.

Partially Correct.

Correct!

Correct!

7.      Given the following line of code, which of the following commands will print Blue? (Hint: If you are not sure, try running the code in the Kotlin Playground.)

val colors = listOf("Red", "Green", "Blue")

Choose as many answers as you see fit.

Partially Correct.

Correct!

Correct!

8.      The programming concept of a class that has only one instance is called a ___.

Correct!

9.      Which of the following statements is true regarding sets and maps?

10.  If you have a variable named records, which is a collection, to determine the number of items it contains, you can call ___.

29 Oktober 2022

Android Basics with Compose

 

 

  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")
}

.

false

  1. 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!

  1. Which is not a basic concept of object-oriented programming

Readability

  1. Which are the four visibility modifiers in Kotlin?

private, protected, public, internal

public, protected, static, internal

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

super

Correct!

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

Interface

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

An optional profile picture.

A unique ID given to every user.

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

?.

  1. Which is not true of functions in Kotlin?

A function can be changed to another data type, and vice versa.

  1. A function literal is another name for a ___

Lambda expression

Function reference

 

28 Oktober 2022

Android Basics with Compose

 

Add a button to an app

  1. Use a(n) ___ Composable to display an image

    Incorrect.

  2. Alignment.Center centers UI components both horizontally and vertically.

    Correct!

  3. Composable functions can store an object in memory using the ___ composable

    Correct!

  4. The debugger allows you to inspect variables when code execution has been suspended.

    Correct!

  5. By using ___ values in a composable function, variables can be made into observables that schedule a recomposition when their value is changed.

    Correct!

  6. The ___ composable places its children in a vertical sequence.

    Incorrect.

  7. The ___ debugger feature allows you to navigate back up the call stack.

    Correct!

#QUIZ Faktor bentuk

  Faktor bentuk Class ukuran jendela ditentukan oleh seluruh layar fisik untuk multitasking atau segmentasi lainnya. Benar Salah Class ukura...