I am trying to print length of java reflection method reference variable which stores all the methods of an class. I am getting NullPointerException exception.
public class Driver_Script {
public static Actionkeywords actionkeywords;
public static Method[] method;
public Driver_Script() {
actionkeywords = new Actionkeywords();
method= actionkeywords.getClass().getMethods();
}
public static void main(String[] args) throws Exception {
ExcelUtils.setExcelFile(Constants.Path_TestData,Constants.Sheet_TestSteps);
int s = method .length;
System.out.println(s);
}
Aucun commentaire:
Enregistrer un commentaire