Here you can find the source of instanceOf(final Class> classVerifiable, final Class> classAssignable)
Parameter | Description |
---|---|
classVerifiable | the class verifiable |
classAssignable | the class assignable |
public final static boolean instanceOf(final Class<?> classVerifiable, final Class<?> classAssignable)
//package com.java2s; public class Main { /**/* w w w . j av a 2 s . c o m*/ * The instanceof command is used to determine if a Java class is of a * given type. The classVerifiable argument specifies an class handle. * The classAssignable specifies an interface or class. If the type * argument is a class name, instanceof will return true if the * classVerifiable is an instance of classAssignable class. If the type * argument is an interface, method returns true if the classVerifiable * argument implements the interface. Otherwise, returns false. * * @param classVerifiable the class verifiable * @param classAssignable the class assignable * @return true, if <classVerifiable> instanceof <classAssignable> */ public final static boolean instanceOf(final Class<?> classVerifiable, final Class<?> classAssignable) { return classAssignable.isAssignableFrom(classVerifiable); } }