|
Java™ by example!
|
|
|
How do I create an instance of a primitive type using reflection?
You have to use the appropriate wrapper classes that are associated with the primitive types:
This example shows you how to go about creating a Boolean wrapper and converting it to its corresponding primitive type. Main.java:
Further Information
Author of answer: Joris Van den Bogaert
Comments to this answer are only viewable by members. Login or become a member!
|
|
|
|
|