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 purpose of "virtual"?
Can java hashmap have duplicate keys?
how do I create a runnable with inheritance? : Java thread
Can we write class inside a class in java?
Why vector class is used?
What are the Main functions of Java?
What is the requirement of thread in java?
What is final, finally, finalize?
What is class variable java?
Write a program in java to establish a connection between client and server?
Whats the difference between notify() and notifyall()?
What is the finalize method do?
What technique is carried out to find out if a particular string is empty?
What is type safety in java?
Explain working of call by reference function invoking.