Package com.wen;
Import java.lang.reflect.Array; import java.lang.reflect.method; import java.util.arrayList;
/ ** *
Title: p> *
Description: According to the incoming Class and Property, the value of the attribute of the attribute p> *
Copyright: CopyRight (C) 2004 P > *
Company: p> * @Author not attributable * @version 1.0 * /
public class Reflect {public static String get (Object object, String methodname, int i) {Class cls = object.getClass (); Object ret; try {Method method = cls.getMethod (methodname, null); ret = method.invoke (CLS.NEWINSTANCE (), NULL); ArrayList Array = New ArrayList (); if (Ret.getClass (). Isarray ()) {RET = Array.get (RET, I);}} Catch (Exception E) { Ret = null;} if (ret == null) {Return null;} return ret.tostring ();}}