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 the use of System class?
Is main an identifier?
Give the difference between the println method and sqrt method?
What is the full name of java?
What is a flag variable?
Do we need to manually write Copy Constructor?
what do you understand by synchronization? : Java thread
What is the name of the java compiler?
How do you clear a list in java?
What is method in java with example?
How does indexof work?
What is anagram of a string?
Write a program to find the whether a number is an Armstrong number or not?
How big is a pointer?
What is return in java?