Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

isinstance java

public class MyClass{
	//...
}

Object m=new MyClass();
Object o=new Object();
boolean mInstanceOf=m instanceof MyClass;//true
boolean oInstanceOf=o instanceof MyClass;//false
boolean misInstance=MyClass.class.isInstance(m);//true
boolean oisInstance=MyClass.class.isInstance(o);//false
 
PREVIOUS NEXT
Tagged: #isinstance #java
ADD COMMENT
Topic
Name
8+2 =