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 do you define a singleton class?

0 Answers  


What is Ideal Design of Class?

2 Answers  


Describe the term diamond problem.

0 Answers  


What are interfaces?

3 Answers  


What environment variables are required to be set on a machine in order to run Java programs?

0 Answers   Tech Mahindra,






What is use of static in java?

0 Answers  


Is minecraft java edition free?

0 Answers  


What are the main uses of java?

0 Answers  


Can you extend singleton class?

0 Answers  


What is exception in java?

0 Answers   Cyient,


What is keyset in java?

0 Answers  


What is string substring?

0 Answers  


Categories