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 |
What are the advantages and disadvantages of Kotlin?
How to make a class data class ?
Which type of programming does kotlin support?
How to declare variable in Kotlin ?
Does Kotlin support primitive Datatypes?
Differentiate between val and var in Kotlin?
How to declare variables in Kotlin?
What is inner class in Kotlin?
Give a syntax for declaring a variable as volatile in Kotlin?
What are the modifiers that are available in kotlin?
Explain Higher-Order Functions?
How can you declare a variable in Kotlin?