Top "This" questions

Keyword that refers to the current class instance or object in many object-oriented programming languages.

php - unset $this

I've made a class that acts like an file wrapper. When user call delete method, i want to unset the …

php file wrapper this unset
Should I use "this" keyword when I want to refer to instance variables within a method?

My teacher says that when I try to access an instance variable within a method I should always use the …

java scope this instance local
Is it safe to return *this as a reference?

Returning reference to this object is often used in assignment operator overloading. It is also used as a base for …

c++ reference this this-pointer
Using new (this) to reuse constructors

This came up recently in a class for which I am a teaching assistant. We were teaching the students how …

c++ this placement-new
shared_ptr and the this-pointer

OK, I started using shared-pointers and pass shared-pointers as much as possible. No conversion to raw pointers anymore. This works …

c++ this this-pointer shared-ptr
Why is "this" undefined in this class method?

I've tried to search over what seems to be the entire internet, but I'm still vexed by a problem with …

javascript node.js this undefined es6-class
What object javascript function is bound to (what is its "this")?

I know that inside the function it is this. var func = function { return this.f === arguments.callee; // => true, if …

javascript function functional-programming this ecmascript-5
How to use requestAnimationFrame with a TypeScript object?

I have an object that i want to do drawing on a canvas. It will use requestAnimationFrame to start a …

javascript this typescript requestanimationframe
Why `this.synchronized` instead of just `synchronized` in Scala?

In an example of working with JDBC in Scala, there is a following code: this.synchronized { if (!driverLoaded) loadDriver() } Why …

multithreading scala this synchronized
Java explicit constructor invocation & Instance Initializer

In The Java Tutorials - Initializing Fields, have a description about Instance Initialization Blocks(Instance Initializer): The Java compiler copies …

java constructor this super invocation