-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathClassFoeNameTest.java
26 lines (26 loc) · 997 Bytes
/
ClassFoeNameTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import java.lang.reflect.Method;
public class ClassFoeNameTest {
public void getData(){
System.out.println("execution getData.....");
}
}
class ForNameTest{
public static void main(String args[])throws ClassNotFoundException,InstantiationException,IllegalAccessException{
Class loadclass=Class.forName("ClassFoeNameTest");
System.out.println("number of methods: "+loadclass.getMethods().length);
Method[] method=loadclass.getMethods();
for(Method m : method ){
System.out.println("method names : "+ m.getName());
}
ClassFoeNameTest obj=(ClassFoeNameTest)loadclass.newInstance();
obj.getData();
}
}
//typage dynamique en java
//final
//clone
//abstract class
//abstract
//les interfaces
//extend pour les class et les classes abstraits , implement c'est pour les interfaces
// la gestion des exeptions