Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    public static Class getDeclaredMethodClass(Class clazz, String methodName, Class... params) {
        do {
            try {
                clazz.getDeclaredMethod(methodName, params);
                return clazz;
            } catch (NoSuchMethodException e) {
                clazz = clazz.getSuperclass();
                if (clazz == null) {
                    return null;
                }
            }
        } while (true);
    }
}