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 the important feature of inheritance?
design a c++ class for the chess board,provide a c++ class definition for such class(only class definition is required)
How to call a non virtual function in the derived class by using base class pointer
What is polymorphism oop?
What does and I oop mean?
What is object and class in oops?
Write a program to compute for numeric grades for a course. The course records are in a file that will serve as the input file. The input file is in exactly the following format: Each line contains a student's first name, then one space, then ten quiz scores all on one line. The quiz scores are in whole number and are separated by one space. Your program will take it input from this file and sends it output to a second file. The data in the output file will be exactly the same as the data in the input file except that there will be one additional number (of type double) at the end of each line. This number will be the average of the student's ten quiz scores. Use at least one function that has file streams as all or some of its arguments.
Is enum a class?
What are the 5 oop principles?
program for insertion ,deletion,sorting in double link list
Why is destructor used?
How do you define a class in oop?
Can a destructor be called directly?
What is polymorphism what is it for and how is it used?
Describe these concepts: Polymorphism, Inheritance and Abstraction.