I have a java class. I want get all methods of this class that are public and defined in the class. My code is as follows:
public class Class1
{
private String a;
private String b;
public void setA(String a){
this.a = a;
}
public void setB(String b){
this.b = b;
}
public String getA(){
return a;
}
private String getB(){
return b;
}
}
I want Only to get setA
, setB
, and getA
and then run this methods.
How do I do?