What are the operands of instanceof operator?

Answers were Sorted based on User's Feedback



What are the operands of instanceof operator?..

Answer / ravikiran(aptech mumbai)

object and class

Is This Answer Correct ?    7 Yes 0 No

What are the operands of instanceof operator?..

Answer / sireeshabojedla

Object and class

Is This Answer Correct ?    2 Yes 0 No

What are the operands of instanceof operator?..

Answer / shaik baji

"instanceof" is a java keyword and it comes under binary
operators.

For "instanaceof" operator
the first operand is : any instance or object
the second operand is : any class name

For Ex:
-------

class Demo
{}
class InstanceofDemo
{
public static void main(String[] args)
{
Demo obj = new Demo();
if (obj instanceof Demo)
System.out.println("yes");
else
System.out.println("no");
}
}

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Core Java Interview Questions

What is the relationship between class and object?

0 Answers  


How will you get the platform dependent values like line separator, path separator, etc., ?

0 Answers  


Can we override static methods?

18 Answers   Bally Technologies,


What is difference between Heap and Stack Memory?

0 Answers  


we have syntax like for(int var : arrayName) this syntax is to find whether a number is in the array or not.but i want to know how to find that number's location.

0 Answers  






How to sort elements in a parallel array in java?

0 Answers  


What is string immutability?

0 Answers  


Which class is the superclass of all classes?

0 Answers  


Considering notepad/ie or any other thing as process, what will happen if you start notepad or ie 3 times? Where 3 processes are started or 3 threads are started?

0 Answers  


What is json parser in java?

0 Answers  


what is java bean?where can we use it?

12 Answers   TCS,


Is alive method in java?

0 Answers  


Categories