PRASHNIKAप्रश्निका
Back to the paper

State any one purpose of using the keyword `this` in Java programming.

Computer Science20231 markShort answer

Answer

Answer

AI
The keyword this refers to the current object. It is used to tell an instance variable apart from a local variable or parameter with the same name, e.g. this.num = num; in a constructor. (It can also be used to call another constructor of the same class or to pass the current object as an argument.)
Methods

From ISC 2023 Computer Science Paper 1, question 1(viii).