It also allows you to configure your program to use specific classes at runtime. For example,
JDBC (Java Database Connectivity) requires a driver class that knows how to access a database. Each database (such as Oracle, Microsoft SQL Server, Microsoft Access) has its own driver class associated with it. One way to configure a program that uses a database is to put the name of the JDBC driver class in a config file. The program then reads the class name from the file and uses the Reflection API to load it. Using the scheme, you can change the underlying database fairly easily by simply editing the config file. Such a change does not require you to recompile the program.
For more information on the Reflection API,
you should check out
this tutorial.
Layne