1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
package retest;
interface InterfAddOn1 {
public void AfficheTest1(String sStrTest);
}
public class Ctest {
public Ctest() {}
public void unTest(String sClassNameR) {
String sClassName = "PackTestAddon.TestClass1";
try {
Object oObj = Class.forName(sClassName).newInstance();
((InterfAddOn1) oObj).AfficheTest1(" Hello World ");
} catch (ClassNotFoundException ex1) {
System.out.println("ERR Class not found");
} catch (IllegalAccessException ex1) {
System.out.println("ERR Illegal Access");
} catch (InstantiationException ex1) {
System.out.println("ERR Instantiation Exception");
}
}
} |