Kotlin Language Essentials for Android
var vs val, null safety, data classes, when expressions, extension functions, scope functions and fundamental Kotlin concepts
1What is the difference between 'var' and 'val' in Kotlin?
What is the difference between 'var' and 'val' in Kotlin?
คำตอบ
'var' declares a mutable (modifiable) variable, while 'val' declares an immutable (read-only) variable. It's recommended to use 'val' by default to promote immutability and avoid bugs.
2What does the '?' operator after a type mean in Kotlin?
What does the '?' operator after a type mean in Kotlin?
คำตอบ
The '?' operator indicates that the variable can contain null. For example, 'String?' means the variable can be a String or null. This is the basis of Kotlin's null safety system.
3What does the '!!' operator do in Kotlin?
What does the '!!' operator do in Kotlin?
คำตอบ
The '!!' operator (not-null assertion) forces the compiler to treat a nullable value as non-null. If the value is null, a NullPointerException is thrown. Only use when you're certain the value is not null.
What is the Elvis operator '?:' used for in Kotlin?
What is a data class in Kotlin?
+21 คำถามสัมภาษณ์
หัวข้อสัมภาษณ์ Android อื่นๆ
Android Fundamentals
Android UI and Resources
Android Lifecycle
Android Navigation
Android Data Management
Android Networking
Android Testing
Android Gradle
Room Database
Background Work
Jetpack Compose
Permissions and Device Features
Firebase for Android
Android MVVM Architecture
Advanced Android Networking
Kotlin Collections and Operators
Kotlin Coroutines and Flow
Android Dependency Injection
Android MVI Architecture
Android Clean Architecture
Android Compose Advanced
Android Performance and Monitoring
Android Security and Privacy
Android CI/CD and Release
Android UX and Form Factors
Android Testing Advanced
เชี่ยวชาญ Android สำหรับการสัมภาษณ์ครั้งถัดไป
เข้าถึงคำถามทั้งหมด flashcards แบบทดสอบเทคนิค แบบฝึกหัด code review และตัวจำลองสัมภาษณ์
เริ่มใช้ฟรี