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 pure oop?

1105


What are objects in oop?

1108


What is oops with example?

1049


What is oops in simple words?

1101


can inline function declare in private part of class?

4412


what is different between oops and c++

2548


Prepare me a program for the animation of train

2477


What is basic concept of oop?

1168


What is ambiguity in inheritance?

1120


Can a varargs method be overloaded?

1106


How to improve object oriented design skills?

1017


What is abstraction in oop with example?

1128


What is Difference Between Inheritance and creating object and getting data? means Class A extends B{ B.getMethod();} (OR) Class A{ b obj=new B(); obj.getMethod(); }

2609


What do you mean by variable?

1040


Can bst contain duplicates?

1193