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
why are wait(), notify() and notifyall() methods defined in the object class? : Java thread
What is a null class?
Should a main method be compulsorily declared in all java classes?
Explain the difference between static and dynamic binding in java?
Can we force garbage collector to run ?
Are static members inherited to sub classes?
Why is java multithreaded?
What is arrays fill in java?
Is void a keyword in java?
what is the difference between thread and runnable types? : Java thread
What are different ways of object creation in java ?
What are different access specifiers in java?
describe method overloading
Is math class static in java?
What does a boolean method return?