Java tutorial
//package com.java2s; import java.lang.reflect.Field; public class Main { public static String[] getPropertyNames(Object object) { Field[] fields = object.getClass().getDeclaredFields(); String[] propertyNames = new String[fields.length]; for (int i = 0; i < fields.length; i++) { propertyNames[i] = fields[i].getName(); } return propertyNames; } }