Differentiate between generics in and out in Kotlin?
Answer / Nipander Singh
'in' is used to specify that a particular type can be passed as an argument, while 'out' is used to specify that a particular type can be returned. For example: fun <T> myFunction(t: T): T {} means T can be any type and the function returns the same type.
| Is This Answer Correct ? | 0 Yes | 0 No |
Does Kotlin allow macros?
What are the features available in kotlin but not in java?
What is nested class in Kotlin?
What are the major features of Kotlin?
What are the features that kotlin support and java doesn’t?
List down some kotlin data class built in methods?
What are some of the features which are there in Kotlin but not In Java?
What is the extension of Kotlin file?
What is the difference between const vs val?
Why is Kotlin preferred over Java? Important benefits of kotlin?
How do you migrate the code from Java to Kotlin ?
Who is the developer of Kotlin?