You are viewing a single comment's thread. Return to all comments →
Using java 7:
public static void main(String[] args) throws ClassNotFoundException { Class student = Class.forName("Student"); Method[] methods = student.getDeclaredMethods(); ArrayList<String> methodList = new ArrayList<>(); for(Method method : methods){ methodList.add(method.getName()); } Collections.sort(methodList); for(String name: methodList){ System.out.println(name); }
}
Seems like cookies are disabled on this browser, please enable them to open this website
Java Reflection - Attributes
You are viewing a single comment's thread. Return to all comments →
Using java 7: