Java tutorial
//package com.java2s; import java.lang.reflect.Field; public class Main { public static boolean ClassHasField(Class<?> cls, String fieldName) { Field[] fields = cls.getFields(); for (int i = 0; i < fields.length; i++) { if (fields[i].getName().equals(fieldName)) { return true; } } return false; } }