java - Calling a class having its name as a string -


i have string specifies name of call. how can call particular class using string.am trying in java. function return me list of strings class names.now task make call class using string.

you can using code:

class clazz = class.forname(yourstring); 

as class name should use full class name including packages. can't call class. can initialize class , call method of class.

http://docs.oracle.com/javase/8/docs/api/java/lang/class.html#forname(java.lang.string


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -