Java Class InstanceOf instanceOf(Object obj, String className)

Here you can find the source of instanceOf(Object obj, String className)

Description

instance Of

License

Apache License

Declaration

public static boolean instanceOf(Object obj, String className) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static boolean instanceOf(Object obj, String className) {
        boolean check;

        try {/*  w ww . j  a v  a2 s.co m*/
            check = Class.forName(className).isInstance(obj);
        } catch (ClassNotFoundException e) {
            check = false;
        }

        return check;
    }
}

Related

  1. instanceOf(final Object a, final Class b)
  2. instanceOf(final Object object, final Class... classes)
  3. instanceOf(Object o, Class clazz)
  4. instanceOf(Object o, Class c)
  5. instanceOf(Object o, Class... classes)
  6. instanceOf(Object obj, String className)
  7. instanceOf(Object obj, String name)
  8. instanceOf(Object object, Class clazz)
  9. instanceOfAll(Object o, Class... clazzes)