‹ Back to the paper
Question 1(viii)
1 mark
Computer ScienceISC 2023 Computer Science Paper 1Short answerMethods
Answer the following.
State any one purpose of using the keyword this in Java programming.
Answer
Answer
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.)