Android App Development
iOS App Development
Flutter App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 3.0.3.7 release ready!
Deniel Kerr
Founder. Opencart
Top Partners
In this blog, we going to discuss Reflection in Kotlin.
Inside of program file some time we want to utilize some classes and its member like constructor, functions and variables runtime. We can use Reflection in Kotlin for utilizing the functionality at runtime.
Reflection is a set of languages and library feature that help us to introspect structure of our program at runtime.
Reflection provides the API feature of java reflection and its own set of functionality.
We can get the reference of the class at runtime if the class is statically known. For the class reference we use the class reference operator.
Obtaining the reference of a class from its instance is known as bounded class reference.
We can get the reference of the function by preceding the function name with :: operator.
We can get the reference of the named function on kotlin and pass these reference as parameter to the another functions.
If is same as the function reference and property reference. On the constructor reference we reference simply by preceding the class name with :: operator like below:
In this blog, we have learned Reflection in Kotlin and its uses.
For more information regarding the Sealed classes in Kotlin follow link.
Thanks for reading this blog. You can also check other blogs from here.
Your email address will not be published. Required fields are marked*
Name*
Email*
Save my name email and website in this browser for the next time I comment.
Be the first to comment.
We use cookies to personalize your experience. By continuing to visit this website you agree to our use of cookies. Learn more about privacy policy
Webkul is a truly trusted and supported IT Company to develop business ideas for e-commerce. They provide professional support after deploying the solution to production and be responsible to act for fixing the reported issues or system errors. We highly encourage to deal with Webkul for business development.
Hussein Zawia
Co-founder, 24Dokan
USA
India
Global
Name
Email
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.