打印字段
/* 来 自* 时代Java */ //package com.nowjava; import java.lang.reflect.*; import static java.lang.System.out; public class Main { public static void printFields(Class<?> c) { Field[] fields = c.getFields(); out.format("Fields => %n"); if (fields.length == 0) { out.format(" --%s", "No declared field found"); } else { for (Field f : fields) { out.format(" %s %s %s%n", Modifier.toString(f /** from 时 代 J a v a - nowjava.com**/