Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.lang.reflect.Field;

public class Main {

    private static Field getFieldByNameFromAnywhere(Class<?> aClass, String fieldName) {
        Field result = null;
        try {
            result = aClass.getDeclaredField(fieldName);
        } catch (Exception e) {
            result = getFieldByNameFromAnywhere(aClass.getSuperclass(), fieldName);
        }
        return result;
    }
}