Top "Instanceof" questions

instanceof is an operator available in some object-oriented languages, including Java, php and JavaScript.

How to efficiently check if variable is Array or Object (in NodeJS & V8)?

Is there any way to efficiently check if the variable is Object or Array, in NodeJS & V8? I'm writing …

javascript node.js v8 instanceof typeof
Any reason to prefer getClass() over instanceof when generating .equals()?

I'm using Eclipse to generate .equals() and .hashCode(), and there is an option labeled "Use 'instanceof' to compare types". The …

java eclipse equals instanceof
instanceof Vs getClass( )

I see gain in performance when using getClass() and == operator over instanceOf operator. Object str = new Integer("2000"); long starttime = System.…

java class instanceof
The performance impact of using instanceof in Java

I am working on an application and one design approach involves extremely heavy use of the instanceof operator. While I …

java performance instanceof
How to see if an object is an array without using reflection?

How can I see in Java if an Object is an array without using reflection? And how can I iterate …

java arrays gwt instanceof
Why does instanceof return false for some literals?

"foo" instanceof String //=> false "foo" instanceof Object //=> false true instanceof Boolean //=> false true instanceof Object //=> false …

javascript literals instanceof
How to perform runtime type checking in Dart?

Dart specification states: Reified type information reflects the types of objects at runtime and may always be queried by dynamic …

dynamic dart instanceof dart-mirrors
How to test if one java class extends another at runtime?

How to I test if a is a subclass of b? Class<?> a = A.class; Class<?> …

java subclass instanceof class-hierarchy
Is there something like instanceOf(Class<?> c) in Java?

I want to check if an object o is an instance of the class C or of a subclass of …

java reflection instanceof
Test if object is instanceof a parameter type

Is there a way to determine if an object is an instance of a generic type? public <T> …

java generics instanceof