Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What are the operands of instanceof operator?

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


Please Help Members By Posting Answers For Below Questions

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

1973


What are scriptlets?

1137


How will you serialize a singleton class without violating singleton pattern?

2005


Explain the difference between association, aggregation and inheritance relationships.

1154


What about member inner classes?

1158


What is an infinite loop in java? Explain with an example.

1111


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.

2077


Detail discussions on JVM, memory management and garbage collector.

1031


What is implicit object in java?

1126


When is the finally clause of a try-catch-finally statement executed?

1137


Why do we need data structure in java?

1120


I want to re-reach and use an object once it has been garbage collected. Define how it’s possible?

1067


Explain method local inner classes ?

1094


What is the difference between replace and replace all?

1072


Tell me how many ways are there to initialise an integer with a constant.

1154