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
what are the realtime excercises in C++?
is there any choice in opting subjects like 4 out of 7
How do you answer polymorphism?
What is byval and byref? What are differences between them?
What does no cap mean?
What is difference between polymorphism and inheritance?
What are functions in oop?
Can static class have constructor?
What is a class and object?
What is abstraction and encapsulation?
any one please tell me the purpose of operator overloading
How to use CMutex, CSemaphore in VC++ MFC
Which is not an object oriented programming language?
write a code for this:trailer recordId contains a value other than 99, then the file must error with the reason ‘Invalid RECORD_ID’(User Defined Exception).
What is encapsulation oop?