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 json parser in java?
Can you explain the private protected field modifier?
What methodology can be utilized to link to a database?
How many types of thread in java? give the name
What is a method header?
How to display all the prime numbers between 1 and n (n is the number, get the input from user)
Write a program to find maximum and minimum number in array?
Give us a program to check for parenthesis matching using stack.
What is dynamic dispatch in java?
Can an interface be defined inside a class?
why string is not taking as primitive datatypes but we r taking it as a class? why explain it?
what is meant by package in java?