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 to declare unique ArrayList ?
What is default constructors?
How to access arraylist elements in java?
Write a method that will remove given character from the string?
Difference between Array and vector?
How would you format a date in java? I.e. In the ddmmyyy format?
What is class variable java?
How does map works in java?
What does null mean in java?
What is style and indentation?
Can singleton class be cloned?
Does A Class Inherit The Constructors Of Its Superclass?