Class.isAssignableFrom

Class.isAssignableFrom

Class Overview | Class Members | This Package | All Packages

Syntax
public native boolean isAssignableFrom( Class cls )
Description
Determines if the class or interface represented by this Class object is either the same as, or is a superclass or superinterface of, the class or interface represented by the specified Class parameter. It returns true if so, false otherwise. If this Class object represents a primitive type, returns true if the specified Class parameter is exactly this Class object, false otherwise.

Specifically, this method tests whether the type represented by the specified Class parameter can be converted to the type represented by this Class object via an identity conversion or via a widening reference conversion. See The Java Language Specification, sections 5.1.1 and 5.1.4 , for details.

Exceptions
NullPointerException if the specified Class parameter is null.