Java Class Name Get classname(Object obj)

Here you can find the source of classname(Object obj)

Description

classname

License

Open Source License

Declaration

public static String classname(Object obj) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String classname(Object obj) {
        if (obj != null && obj.getClass().getEnclosingClass() == null) {
            return obj.getClass().getSimpleName();
        } else {/*from w w w  . j  a v  a 2  s .c o m*/
            return null;
        }
    }
}

Related

  1. className(Class aClass)
  2. className(final Class c)
  3. className(final Object object)
  4. className(Object o)
  5. className(Object o)
  6. className(Object obj)
  7. className(Object object)
  8. className(Object value)
  9. className(String classFile, String pre)