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 difference between inheritance and polymorphism?
How to handle exception in c++, For example in a functions i am assigning memory to some variables and also in next instructions in am dividing one variable also. If this functions generates a error while allocating memory to those variable and also while dividing the variable if i divide by zero then catch block how it will identify that this error has cone from perticular instruction
which feature are not hold visual basic of oop?
write a program to enter a string like"sunil is a good boy and seeking for a job" not more than 10 characters including space in one line,rest characters should b in other line.if the next line starts from in between the previous word,then print whole word to next line.
Why is polymorphism important in oop?
What is encapsulation selenium?
Can a varargs method be overloaded?
What is oops and its features?
Templates mean
What is pure oop?
What does and I oop mean?
What is the point of oop?
What is difference between oop and pop?
What is the full form of oops?
Write A Program to find the ambiguities in Multiple Inheritance? How are they resolved.(Virtual Functions)