Skip to content
Sharp

Object-oriented programming · interview question

What does the 'this' keyword refer to within an instance method of a class?

Multiple choiceMediumchapter-2-curatedpremiumoopclasses-and-objects
Choose one answer
Answer and explanation

Correct answer

C. The current object

Why

The 'this' keyword refers to the current object within an instance method. It is used to access instance variables and methods of the class, and to resolve conflicts between instance variables and parameters.

Test yourself on Object-oriented programming

A free test with instant, explained results. No account needed.

Start free test
All Object-oriented programming questions →