Both can be used for creating objects at runtime. The difference is that Class.forName has the class name as a
string parameter, which can be set at runtime. That means the class to be created does not have to be known at compile time (and thus does not even need to be present in the classpath).
Strictly speaking, Class.forName doesn't create an object - it only loads the class, causing static initializers to run. Class.forName("...").newInstance() cause an actaul object to be created.