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 is the function of 'this' operator ?

Answer Posted / venkat

'this' is used to reffer current class variable

for example

class sample
{

int myvar=10;
void mymethod()
{
int myvar=20;
system.outprintln("The value of myvar is"+myvar)
system.outprintln("The value of myvar is"+this.myvar)
}
}


output :
20,10

Is This Answer Correct ?    39 Yes 15 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is an interface in oop?

984


What is encapsulation with real life example?

977


What are the 4 main oop principles?

1162


what are the different types of qualifier in java?

2217


What do you mean by Encapsulation?

1022


Why multiple inheritance is not possible?

1018


What is the point of polymorphism?

995


What is abstraction oop?

1027


what type of questions

2065


when to use 'mutable' keyword and when to use 'const cast' in c++

2110


what is the drawback of classical methods in oops?

3315


What does and I oop and sksksk mean?

1108


What is encapsulation with example?

1024


What is the purpose of enum?

965


What is the difference between abstraction and polymorphism?

1048