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
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
write a C++ program for booking using constructor and destructor.
What is oops and its features?
what is different between oops and c++
Where is pseudocode used?
Can you inherit a private class?
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 reinterpret cast is considered dangerous?
• What are the desirable attributes for memory managment?
What is new keyword in oops?
Write a program to sort the number with different sorts in one program ??
What is constructor overloading in oop?
What is data binding in oops?
Can abstract class have normal methods?
What is encapsulation in oops?