Hi. I am trying to write a function that when given a class, will tell you the number of methods that class has. I am getting the java.lang.noclassfoundexception message. I read something about adding to the PATH but was unsure. I also tried using HelloWorld.class, but that did not work either. Any help would be much apreciated. Below is my code:
String test = "HelloWorld.java";
Class cls = Class.forName(test);
int Mcount = cls.getDeclaredMethods().length;
System.out.println("Mcount = " + Mcount);