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 class encapsulation?
Which language is not a true object oriented programming language?
Which language is pure oop?
Can main method override?
Why is encapsulation used?
Why do while loop is used?
What is object in oop with example?
What is ambiguity in inheritance?
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
Describe these concepts: Polymorphism, Inheritance and Abstraction.
How do you achieve runtime polymorphism?
What are the benefits of oop?
What is difference between oop and pop?
What is polymorphism what are the different types of polymorphism?
What is abstraction in oop?