Questions for Null Safety and Smart Casts

1. What is null safety in Kotlin, and how does it differ from traditional programming languages?

2. What are safe calls (`?.`) in Kotlin, and how are they used?

3. What is the Elvis operator (`?:`), and how does it simplify null handling in Kotlin?

4. How does the `!!` operator work in Kotlin, and why should it be used cautiously?

5. What is a smart cast in Kotlin, and how does it enhance type safety?

6. How does Kotlin's `is` operator work, and how does it enable smart casts?

7. What is the difference between `let` and safe calls (`?.`) in handling null values?

8. How does Kotlin handle platform types, and how do they relate to null safety?

9. How does Kotlin's `!!` operator compare to safe calls (`?.`) in handling null values?

10. What are nullable collections in Kotlin, and how can they be handled safely?

11. How does Kotlin's `safe cast` operator (`as?`) work, and when should you use it?

12. What are `lateinit` and `lazy` in Kotlin, and how do they differ in handling initialization?

13. How does Kotlin ensure smart casts are safe during runtime?

14. When does a smart cast not work, and how can you handle such cases?

15. How do smart casts work with `when` expressions in Kotlin?

16. Can smart casts be used with custom classes, and how does Kotlin handle it?