Top "Instanceof" questions

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

instanceof check in EL expression language

Is there a way to perform an instanceof check in EL? E.g. <h:link rendered="#{model instanceof ClassA}"&…

jsf el instanceof
Throw and catch an exception, or use instanceof?

I have an exception in a variable (not thrown). What's the best option? Exception exception = someObj.getExcp(); try { throw exception; } …

java performance exception instanceof throws
What's the point of new String("x") in JavaScript?

What are the use cases for doing new String("already a string")? What's the whole point of it?

javascript string types instanceof typeof
Can I set the type of a Javascript object?

I'm trying to use some of the more advanced OO features of Javascript, following Doug Crawford's "super constructor" pattern. However, …

javascript oop types instanceof typeof
How to avoid 'instanceof' when implementing factory design pattern?

I am attempting to implement my first Factory Design Pattern, and I'm not sure how to avoid using instanceof when …

java design-patterns factory factory-pattern instanceof
PHP instanceof for traits

What is the proper way to check if a class uses a certain trait?

php class instanceof traits
Checking if an annotation is of a specific type

I am using reflection to see if an annotation that is attached to a property of a class, is of …

java reflection annotations instanceof isinstance
instanceof Class<?> parameter

I'm trying to write a method to return all objects that match the class it gets as a parameter: public …

java instanceof
The opposite of instanceof

Is it possible to get the opposite of instanceof in java? I have tried code like this: if( example !instanceof …

java instanceof
How to determine if an object is an instance of certain derived C++ class from a pointer to a base class in GDB?

I'm debugging a C++ program with GDB. I have a pointer to an object of certain class. The pointer is …

c++ types gdb superclass instanceof