Question OOP-CLS-0005
EasyWhat does the 'this' keyword refer to in Java and C++?
- A.
The current object
- B.
The parent class
- C.
Show answer and explanation
Answer: A
Inside a method, this refers to the object on which the method was called.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Classes and Objects question
What does the 'this' keyword refer to in Java and C++?
The current object
The parent class
Answer: A
Inside a method, this refers to the object on which the method was called.
The main function
A new object