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 is difference between path and classpath in java?
Variables used in a switch statement can be used with which datatypes?
Why java does not support pointers?
Explain the polymorphism principle?
State some advantages of java?
Can we have multiple classes in single file ?
What is an infinite loop in java? Explain with an example.
How do you check if two strings are equal in java?
What is an example of a constant variable?
What does you mean in math?
What is a buffer in computer?
Can we use switch statement with strings?
What is difference between null and void?
What is the flag in java?
What are different ways of object creation in java ?