Questions
Kotlin questions
Choose a question page, learn the concept, then test your understanding with a quiz.
How to Place the Cursor at the End of an EditText in Android Java
Learn how to keep the cursor at the end of an EditText in Android Java after changing text programmatically.
How to Read Files from src/test/resources in Kotlin
Learn how to read text and HTML files from src/test/resources in Kotlin tests using class loaders and resource streams.
How to Remove Duplicate Strings from an Array in Kotlin
Learn how to remove duplicate strings from an Array<String?> in Kotlin using distinct(), sets, and null-safe examples.
How to Set Text in an EditText in Kotlin
Learn why EditText.text expects Editable in Kotlin and how to correctly set and read text using setText(), text, and toString().
How to Set an OnClickListener in Kotlin for Android
Learn how to use setOnClickListener in Kotlin for Android with clear examples, syntax, common mistakes, and a practical mini project.
How to Update the Kotlin Gradle Plugin in a Flutter Android Project
Learn where to change the Kotlin Gradle plugin version in a Flutter Android project and how it differs from Kotlin stdlib.
How to Use LIKE in Android Room Queries
Learn how to write Room SELECT queries with LIKE in Android, including wildcards, parameter binding, and common mistakes.
How to Use Links and Code Formatting in Kotlin KDoc
Learn how to write links and inline code in Kotlin KDoc, including JavaDoc equivalents, syntax examples, and common mistakes.
How to Use Nullable Boolean in Kotlin if Expressions
Learn the safest way to use Boolean? in Kotlin if expressions, including smart casts, properties, and null-safe alternatives.
How to Use break and continue with forEach in Kotlin
Learn why break and continue do not work directly in Kotlin forEach, and how to use labels, returns, and regular loops instead.
How to Vibrate an Android Device in Java: Vibrator and VibrationEffect
Learn how to make an Android device vibrate in Java using Vibrator and VibrationEffect, including patterns, permissions, and common pitfalls.
How to Work with Multiple Nullable Variables in Kotlin Using let
Learn how to handle multiple nullable values in Kotlin using let, safe calls, guards, and practical null-check patterns.
Idiomatic Logging in Kotlin: Companion Objects, Properties, and Best Practices
Learn the idiomatic way to create and use loggers in Kotlin using companion objects, properties, and practical logging patterns.
IntArray vs Array<Int> in Kotlin: Primitive Arrays and Boxing
Learn the difference between Kotlin IntArray and Array<Int>, JVM int[] versus Integer[], boxing costs, nullability, and when to use each.
Java 8 Stream.collect Equivalents in Kotlin Standard Library
Learn the Kotlin stdlib equivalents to Java 8 Stream.collect with examples for grouping, partitioning, joining, sums, and set/list collection.
Java Static Methods in Kotlin: Equivalents and Best Practices
Learn how Kotlin replaces Java static methods using top-level functions, companion objects, and objects with clear examples.
Java static final Equivalent in Kotlin: Constants with const val and Companion Objects
Learn the Kotlin equivalent of Java static final fields using const val, val, top-level declarations, and companion objects.
Kotlin Anonymous Classes with Object Expressions
Learn how to create anonymous subclasses of abstract classes in Kotlin with object expressions, including Java KeyAdapter examples and common pitfalls.
Kotlin Case-Insensitive String Comparison with equals
Learn how to compare Kotlin strings without case sensitivity using equals(ignoreCase = true), with examples, pitfalls, and practical patterns.
Kotlin Class Property Initialization: lateinit, nullable, and lazy Fields
Learn why Kotlin properties must be initialized and how to use lateinit, nullable types, and lazy initialization for Android class fields safely.