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 tree in java?
What state does a thread enter when it terminates its processing in java programming?
What is strings in java?
How is garbage collection controlled?
What are void methods?
what is the volatile modifier for? : Java thread
What is the best definition for data?
What happens to a static var that is defined within a method of a class?
Can we override the static methods?
What is an example of a boolean?
Explain differences between collection api and stream api?
Is it possible to instantiate the abstract class?
Is java free for businesses?
Explain wrapper classes in java?
Why singleton class is used in java?