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 is an interface in oop?
What is encapsulation with real life example?
What are the 4 main oop principles?
what are the different types of qualifier in java?
What do you mean by Encapsulation?
Why multiple inheritance is not possible?
What is the point of polymorphism?
What is abstraction oop?
what type of questions
when to use 'mutable' keyword and when to use 'const cast' in c++
what is the drawback of classical methods in oops?
What does and I oop and sksksk mean?
What is encapsulation with example?
What is the purpose of enum?
What is the difference between abstraction and polymorphism?