Which of the following statements about the 'this' keyword is incorrect?

  • 'this' can be used to call other class constructors from within a constructor.
  • 'this' is used to reference the current instance of the class.
  • 'this' is used to create a new object of the class.
  • 'this' can be used to access instance variables and methods of the class.
The 'this' keyword in Java is primarily used to refer to the current instance of a class. It can be used to access instance variables and methods, and also to call other constructors of the same class. Option 3 is incorrect; 'this' does not create a new object but references the existing instance. Options 1, 2, and 4 are correct statements.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *