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
Why multiple inheritance is not allowed?
How do you explain polymorphism?
Is data hiding and abstraction same?
What is polymorphism programming?
Why do we use encapsulation in oops?
Templates mean
What is abstraction and encapsulation?
What is the real time example of inheritance?
i=20;k=0;
for(j=1;k-i;k+=j<10?4:3)
{
cout< write a C++ program for booking using constructor and
destructor.
What is class and example? Why do while loop is used? What does and I oop mean? what are the ways in which a constructors can be called? What is coupling in oop?