Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import java.lang.reflect.Method;

public class Main {
    public static Method getPrivateMethod(Object target, String methodName, Class<?>... parameterTypes)
            throws NoSuchMethodException {
        Class targetClass = target.getClass();
        Method method = targetClass.getDeclaredMethod(methodName, parameterTypes);
        method.setAccessible(true);
        return method;
    }
}