Câu hỏi phỏng vấn Kotlin
Câu hỏi

What is the difference betwee...

Câu trả lời

The main difference between * (star projection) and Any in Kotlin generics is:

  • * is used to represent an unknown type parameter in a generic type. It is a wildcard type that can represent any type, but it cannot be used to create a new instance of the generic type. For example, Array<*> represents an array of unknown element type[1].

  • Any is the root of the Kotlin class hierarchy, similar to Object in other languages. It is the common supertype of every Kotlin type, including nullable types. `An...

expert

expert

Gợi ý câu hỏi phỏng vấn

middle

May you use IntArray and an Array is in Kotlin interchangeably?

senior

What is Coroutine Scope and how is that different from Coroutine Context?

junior

What is basic difference between fold and reduce in Kotlin? When to use which?

Bình luận

Chưa có bình luận nào

Chưa có bình luận nào