fbpx

#kotlinDevChallenge – 21

Very fun challenge today.

Your task is to… make the code compile.

Task Description:

  1. State needs to be an interface
  2. You can add member functions or extension functions to State
  3. There are no test cases, after succesfull compilation you’ll se the code.

We want to be able to use destructive declaration on state: State

fun useDestructiveDeclaration(state: State) {
    val (a: String, b: Int) = state
}
  1. Fill in the code.
  2. You can copy the code into IntelliJ/Android Studio, but it shouldn’t be necessary.
  3. Click “run” – the green triangle. The code will compile and several tests will be run.
  4. In the logs, you will see “try again” if the solution is incorrect, or “success” and a special code.
  5. Provide this code in the form below along with your email and click “send”.

more insights

Uncategorized
Jarosław Michalik

#kotlinDevChallenge 2023 summary

The KotlinDevChallenge was not just a competition, but a journey of learning, growth, and community engagement. Every participant in this challenge is a winner in

Read More »
KotlinDevChallenge2023
Jarosław Michalik

#kotlinDevChallenge – 24

What do you love most about Kotlin? Productivity increase? Idioms? Or that it isn’t Java? Maybe something else! Share it. It can be short. It

Read More »

AndroidPro newsletter 🚀

join 3057 developers reading AndroidPro newsletter every week

👉 tips & tricks, articles, videos

👉 every Thursday in your inbox

🎁 bonus on signup – Clean Architecture blueprint

brought to you by Jarek Michalik, Kotlin GDE

You can unsubscribe any time. For details visit our privacy policy.

android pro newsletter tips and tricks how to learn android