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

Why multiple inheritance is not allowed?

1139


How do you explain polymorphism?

1057


Is data hiding and abstraction same?

995


What is polymorphism programming?

1110


Why do we use encapsulation in oops?

1013


Templates mean

2057


What is abstraction and encapsulation?

1001


What is the real time example of inheritance?

1128


i=20;k=0; for(j=1;k-i;k+=j<10?4:3) { cout<

1839


write a C++ program for booking using constructor and destructor.

2525


What is class and example?

1152


Why do while loop is used?

1014


What does and I oop mean?

1155


what are the ways in which a constructors can be called?

2113


What is coupling in oop?

1005