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 do we need polymorphism in c#?
What is inheritance and how many types of inheritance?
What is object and example?
Explain the concepts involved in Object Oriented programming.
Why is there no multiple inheritance?
What is the oops and benefits of oops programming?
#include
State what is encapsulation and friend function?
write a program using c++ to implement single contiguous memory mangement techniques.display the content of the main memory after yhe allocation of jobs and percentage of the wastage of the main memory
Write a c++ program to display pass and fail for three student using static member function
what is the sylabus for priliminaries?
Why is polymorphism important in oop?
What is abstraction and encapsulation?
What is the difference between a mixin and inheritance?
IS IT NECESSARY TO INITIALIZE VARIABLE? WHAT IF THE INSTANCE VARIABLE IS DECLARED final ? IS IT NECESSARY TO INITIALIZE THE final VARIABLE AT THE TIME OF THEIR DECLARATION?