How does JAVA find the parent class of a string from a string?

for example, the parent class of a normal class IOException is as follows:

Class<?> c = IOException.class;
System.out.println("IOException:"+c.getSuperclass());

but I implement this function: the IOException is saved as a string, and then how do I find the parent class of the class through that string? The last line of the following code indicates an error and cannot be implemented.

clipboard.png

for guidance, thank you!

Nov.10,2021

    Class<?> clazz = null;
    try {
      clazz = Class.forName("java.lang.Exception");
    } catch (ClassNotFoundException e) {
      System.err.println("can not load this class");
    }
    System.out.println(clazz.getSuperclass().getName());

Update:

public static String loadClass(String className) {
    Objects.requireNonNull(className);
    Class<?> clazz = null;
    try {
      clazz = Class.forName(className);
      return clazz.getSuperclass().getName();
    } catch (ClassNotFoundException e) {
      return "";
    }
  }

just do this:

System.out.println (Class.forName ("java.io.IOException"). GetSuperclass ());

)
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b370f6-4ecca.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b370f6-4ecca.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?