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

How to declare unique ArrayList ?

6 Answers   RMSI,


What is default constructors?

0 Answers  


How to access arraylist elements in java?

0 Answers  


Write a method that will remove given character from the string?

0 Answers  


Difference between Array and vector?

9 Answers  






How would you format a date in java? I.e. In the ddmmyyy format?

0 Answers  


What is class variable java?

0 Answers  


How does map works in java?

0 Answers  


What does null mean in java?

0 Answers  


What is style and indentation?

0 Answers  


Can singleton class be cloned?

0 Answers  


Does A Class Inherit The Constructors Of Its Superclass?

0 Answers   Wipro,


Categories