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 |
What is difference between fail-fast and fail-safe?
What is sortedset in java?
How are the elements of a gridbaglayout organized in java programming?
What are the OOAD concepts in java explain with examples?
What is an Exception ?
Why java is a platform independent? Explain
What is a singleton puppy?
What is array size in java?
Why parsing is done?
Difference between method overloading and method overriding in java ?
Why do we override tostring method in java?
What is singleton class and how can we make a class singleton?