Class c = Class.forName("java.lang.String");
Class.forName("com.mysql.jdbc.Driver");
Class c = Class.forName("com.mycompany.MyClass");This example will load the MyClass class from the package com.mycompany, which is a custom package created by the programmer. In all these examples, the Class.forName() method is used to load a class dynamically at runtime, by providing the fully qualified name of the class as a parameter. The package library of the class can be determined from the fully qualified name of the class, which includes the package name and the class name separated by a dot.