wiz-icon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

The use of 'This' operator keyword is.

A
It returns current object
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
B
It creates a new object
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
It kills an object
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
None of the above
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is A It returns current object

The use of 'This' operator keyword is It returns current object.

Keyword THIS is a reference variable in Java that refers to the current object. ... It can be used to refer instance variable of current class. It can be used to invoke or initiate current class constructor. It can be passed as an argument in the method call.

this keyword in java can be used inside the Method or constructor of Class. It(this) works as a reference to the current Object, whose Method or constructor is being invoked. This keyword can be used to refer to any member of the current object from within an instance Method or a constructor.

this keyword in C# Simple explanation of this keyword to make user understand its way of using and implementation. The this keyword refers to the current instance of the class. It can be used to access members from within constructors, instance methods, and instance accessors.


flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Logic Gates
PHYSICS
Watch in App
Join BYJU'S Learning Program
CrossIcon