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 relationship between class and object?
How will you get the platform dependent values like line separator, path separator, etc., ?
Can we override static methods?
18 Answers Bally Technologies,
What is difference between Heap and Stack Memory?
we have syntax like for(int var : arrayName) this syntax is to find whether a number is in the array or not.but i want to know how to find that number's location.
How to sort elements in a parallel array in java?
What is string immutability?
Which class is the superclass of all classes?
Considering notepad/ie or any other thing as process, what will happen if you start notepad or ie 3 times? Where 3 processes are started or 3 threads are started?
What is json parser in java?
what is java bean?where can we use it?
Is alive method in java?