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 length and length() method in java ?
How do you create immutable object in java?
What are concepts of OOPS and how are they implemented in Java?
Are arrays classes in java?
What is the major difference between linkedlist and arraylist?
What are keywords and reserved words in java?
What's the purpose of static methods and static variables?
How does marker interface provides functionality to the implemented class ? or How dose maker interface gets the functionalities as serialization or cloning.
What is stream api in java8?
What is the collections api?
What is incompatible types in java?
What is JVM ? use of JVM?