+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
class Main {
* @param String[] args main() function arguments array
*/
public static void main(String[] args) {
- main_orig(args);
+ String className = args[0];
+ Class cl = null;
+ try {
+ cl = Class.forName(className);
+ }
+ catch (ClassNotFoundException e) {
+ System.out.println("Entered class name do not exist.");
+ System.exit(-1);
+ }
+
+ Field[] fields = cl.getFields();
+ Method[] methods = cl.getMethods();
+
+ for (int i = 0; i < fields.length; i++) {
+ System.out.println(fields[i]);
+ }
+
+ for (int i = 0; i < methods.length; i++) {
+ System.out.println(methods[i]);
+ }
+
}
}