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 hashset and hashmap in java?
Can array grow dynamically in java?
Why string is not a wrapper class?
What restrictions are placed on method overloading in java programming?
What is a linkedhashmap java?
What is getkey () in java?
What are peerless components in java programming?
Why hashset is used in java?
What is the difference between a field variable and a local variable?
What are the two types of java programming?
What is the basic of java?
Explain different states of a thread in java?
Explain different ways of creating a thread. Which one would you prefer and why?
Define how can we find the actual size of an object on the heap?
Can a string be null?