Java tutorial
//package com.java2s; public class Main { public static boolean hasSuperClass(Class<?> obj) { Class<?> SuperClass = obj.getSuperclass(); if (SuperClass == null || obtainClassName(SuperClass).contentEquals("Object")) return false; return true; } public static String obtainClassName(Class<?> obj) { return obj.getSimpleName(); } }