What does `Class.forName()` do in Java reflection?

Java Professional Medium

Java Professional — Medium

What does `Class.forName()` do in Java reflection?

Key points

  • `Class.forName()` does not create a new instance of the class
  • It returns the Class object, not the class name itself
  • This method is commonly used in reflection to dynamically load classes

Ready to go further?

Related questions