For beginners like me that are not very familiar with object oriented concepts, it might be impossible to imagine that Java has a capability to instantiate a class by its name stored in a string variable. However, this is totally possible in Java or even in other programming languages with utilizing reflector/reflection concept.
Take a look at below example,
Now the objective is to create an instance of class A
which its name stored in variable, this code does that.
Now it might be a question what the reflection is used for, the answer is so simple, one practical example is making database connection.
You can refer to the following links for DB connection.