Created
May 17, 2020 22:55
-
-
Save yenerm/0ce0e6e3027b38f6fadff2b3e9395c58 to your computer and use it in GitHub Desktop.
Inline Reified function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inline fun <reified T> printType() { | |
print(T::class.java) | |
} | |
fun printStringType(){ | |
//calling the reified generic function with String type | |
printType<String>() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment