// 下面是代码,记得给分啊!!!
class Bb
{
public String aa;
Bb(String aa){ this.aa = aa; }
}
class Aa
{ Bb newbb = new Bb("1234");
String getClassField(String fieldname,Class classInt) throws Exception
{
if (classInt.getField(fieldname)!=null)
return classInt.getField(fieldname).get(newbb).toString();
throw new Exception(classInt.getName()+ "No Such Field "+fieldname);
}
public String testGet() throws Exception
{
return getClassField("aa",Bb.class);
}
}