java reflection
- by user622222
Hi all,
System.out.println("Class name : ");
BufferedReader reader= new BufferedReader(new InputStreamReader(System.in));
String line = reader.readLine();
Class<?> writeoutClass = Class.forName(line);
Method Writeout = null;
for (Method mth : writeoutClass.getDeclaredMethods()) {
if (mth.getName().startsWith("Writeout")) {
Writeout = mth;
break;
}
It's giving error like that; java.lang.ClassNotFoundException: a
How can i generate that class?