public static boolean classExists(String className){
  try {
    return Class.forName(className) != null;
  }
 catch (  ClassNotFoundException e) {
    return false;
  }
}

public static boolean classExists ( String className ) { try { return Class . forName ( className ) != null ; } catch ( ClassNotFoundException e ) { return false ; } }
helper method to safely check whether a class exists at runtime .
