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 |
How do you define a singleton class?
What is Ideal Design of Class?
Describe the term diamond problem.
What are interfaces?
What environment variables are required to be set on a machine in order to run Java programs?
What is use of static in java?
Is minecraft java edition free?
What are the main uses of java?
Can you extend singleton class?
What is exception in java?
What is keyset in java?
What is string substring?