What are the operands of instanceof operator?
Answers were Sorted based on User's Feedback
Answer / 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 |
What are the main uses of java?
Should database connections be singleton?
What is static and final keyword in java?
What is int lol?
What is the difference between form & report?
Can you sort a string in java?
Difference between string s= new string (); and string s = "abv";?
How do you reverse a string in java?
how does multithreading take place on a computer with a single cpu? : Java thread
What is static import in java?
Why do we use variables?
What is the difference between path and classpath variables?