Stack Overflow archive
1 scoreaccepted

How to get inner class Reflection

score
1
question views
339
license
CC BY-SA 4.0

Inner classes will be compiled and the class file will be ClassName$InnerClassName. See: https://stackoverflow.com/a/11388863/1048340

You need to escape the dollar sign character in Kotlin. The following will work:

Class.forName("example.com.TContract\$Commands\$TIssue")

Originally posted on Stack Overflow. Public user contributions are licensed under Creative Commons Attribution-ShareAlike.