What are the operands of instanceof operator?
Answers were Sorted based on User's Feedback
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 |
Where the CardLayout is used?
How to make class immutable
Why stringbuilder is not thread safe?
can two class in a code be public??if yes then how??
Is array passed by reference in java?
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?
What is the benefit of lambda expressions?
what is the JNDI?
Difference between the String and StringBuffer classes?
What do you mean by platform independence?
do I need to use synchronized on setvalue(int)? : Java thread
What is race condition ?? (Threading concept) TCS 2 sept10