I can view the methods of a class using java reflection.
Method[] methods = Person.class.getMethods();
for(Method method : methods){
System.out.println("method = " + method);
}
the person
class ,
class Person{
String name;
int age;
Person(String name,int age){
this.name = name;
this.age = age;
}
public int count(){
int count = 10*20;
return count;
}
}
Using reflection the count
method will view like,
method = public int Person.count()
but not the implementation (method body).
is there anyway to view the full implementation details of a method using this kind of approach or with any other ?