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 is the Use of throws exception?
What will happen if we cannot mention "finally" in Java Program ???
what is encapsulation in java? Explain
Explain pass by reference and pass by value?
Difference between method overloading and overriding.
What are the main uses of the super keyword?
What is the purpose of setAutoCommit() ?
Differences between jdk 1.4 and 1.5
6 Answers SoftSol, TCS, Wipro,
Why java is used everywhere?
Is space a char?
In treeset we add same object ...what will be the out put
What is the symbol for space?