For example, If I have a Example.java file which as shown below
Class Example{
int a;
int b;
void helloworld(){
System.out.println("HelloWorld");
}
void hello(){
System.out.println("HelloWorld");
}
How can I get the contents of function helloWorld() as a string programmatically, like
void helloworld(){
System.out.println("HelloWorld");
}
I mean it should accept method name as input and return contents of it as string??