I want to convert a string to a class name. Imagine that I have a string, which changes, containing a class name, for example, the string \"MyExampleClass\"
. No
If you are trying to build your classes dynamically, I recommend you to better take a look at the factory method design pattern, otherwise you will be loosing track of who builds what and how.
To do so, you can code a class that receives a string and returns a class depending on the input string.
Take a look at the book "Design Patterns: Elements of Reusable Object-Oriented Software" by Erich Gamma; Richard Helm; Ralph Johnson; John Vlissides.