获得一个对象所属的类 public static void main(String[] args) { long l = System.currentTimeMillis(); System.out.println(((Object) l).getClass().getName()); }