Answer Posted / 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 |
Post New Answer View All Answers
Hi friends am new to java. I read jar file means collection of java files. For executing struts application what are the necessary jar files. " struts.jar " file contains what. can u explain
What are scriptlets?
How will you serialize a singleton class without violating singleton pattern?
Explain the difference between association, aggregation and inheritance relationships.
What about member inner classes?
What is an infinite loop in java? Explain with an example.
we have syntax like for(int var : arrayName) this syntax is to find whether a number is in the array or not.but i want to know how to find that number's location.
Detail discussions on JVM, memory management and garbage collector.
What is implicit object in java?
When is the finally clause of a try-catch-finally statement executed?
Why do we need data structure in java?
I want to re-reach and use an object once it has been garbage collected. Define how it’s possible?
Explain method local inner classes ?
What is the difference between replace and replace all?
Tell me how many ways are there to initialise an integer with a constant.