Answer Posted / 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 |
Post New Answer View All Answers
What does singleton class mean?
What is string immutability?
Is integer a class?
What is a ternary operator in java?
What is arraylist e?
How do you add an element to a set in java?
Can set contain duplicates?
What are instance variables?
Which of the classes will have more memory allocated?
What is arguments in java?
In a program, initializing an array of 100 KB is throwing an out of memory exception while there is 100 MB of memory available. Why?
What are actual parameters?
What are the 5 types of research methods?
what do you mean by classloader in java?
How do you implement polymorphism in our day to day life?