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

Where the CardLayout is used?

1 Answers  


How to make class immutable

6 Answers  


Why stringbuilder is not thread safe?

0 Answers  


can two class in a code be public??if yes then how??

2 Answers  


Is array passed by reference in java?

0 Answers  


Hi am an mca graduate . i have done bsc maths in my degree . every company asks me why you make shift from maths group to computere field . What i need to answer?

2 Answers  


What is the benefit of lambda expressions?

0 Answers  


what is the JNDI?

3 Answers  


Difference between the String and StringBuffer classes?

3 Answers  


What do you mean by platform independence?

0 Answers  


do I need to use synchronized on setvalue(int)? : Java thread

0 Answers  


What is race condition ?? (Threading concept) TCS 2 sept10

3 Answers   SparkTG, TCS,


Categories