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 the final variable?
Explain the difference between arraylist and linkedlist in java?
does core java and j2se both are same?
Is java code slower than native code?
What is a war file?
we cannot create an object of interface but we can create a variable of it
Why singleton class is used in java?
Explain reverse a linked list recursive java solution?
What is the difference between and ?
what is main purpose of abstract class?
What is boolean example?
Can java inner class be static?