So let's return to our object point. And let's again look at its constructor logic. And we're gonna see how to write that default constructor. So here's point. And critical to building new objects in the object oriented world is to write special methods called constructor methods. And always important in construction methods is the default constructor. And the default constructor is a constructor whose signature is empty. Now notice the constructor always has the class name. That's how you determine that this is a constructor. And here's the empty signature. Now notice in here, it looks like I have two arguments x and y, which I do. But that actually both arguments have default values. So this signature by itself, covers a lot of ground. It's a very useful, what you might call abbreviation, because what it's covering is a signature in which you could replace. You could use point with no arguments, point with one argument and point with two arguments. In the no argument case, the point that was created. So if we had declared something like point, r no arguments. R is gonna be created with internal representation, x = 0 and y = 0. In this case, if we had a point q, With one argument, It would invoke this constructor and that would mean that you would have the data value 1.1, 0.0. And then if you add the two argument case, you would have the data point 1.1 and 2.2. Now we're going to see, and we're gonna talk a lot more about constructors, that there are other very important constructors. And almost always, when you build a new object, you have to use a default constructor, but you also have to build something like a copy constructor. And you frequently have one argument constructors which can also be used for conversion possibilities. You might even call them conversion constructors. All of those are very critical and should always be thought about when you create a new object like a point. Now the other thing critical to this, that you might not have seen before is the use of initializer list syntax. Notice that the actual semantics of this constructor as found in the code body. They're empty. It looks like nothing gets executed but that's not true. Because this initialization happened. So instead of it being assignments inside of here. And you could make these assignments. And we'll show that later in a later lecture in this segment that you will be able to use the self-referential pointer this. It'll be able to say something like this arrow x = x. But you can't always do that. And you can't always do that because there is special cases where, for example, the hidden representation is not mutable. Could be a const value, and you can't assign to a const value. So you couldn't use semantics that were in here with assignment. Instead, you must use initialization semantics. So it's very important to understand where initialization semantics are preferable and where they must be used. We'll go on to talk more about this. Again, remember that this pointer is self referential. We talked about that already. There's a keyword, this, that has a special meaning. Again, we'll see all of that in the next slide. We now have three different constructors for point. Two of them, all three can be used to define the default constructor, but the last one is the best use of C++. So here we're just using ordinary assignment. Here we're using this pointer. So this pointer is grabbing the member and the member is getting assigned. Here we're using initializer list. An initializer list means that these values are initializations. Because they're initializations and not assignments. In here they were assignments. It turns out that we have a far larger range of things we can do with this last and best way to do it. So this is my preferred. If, for example, we had a widget in which one of our hidden members that we needed to initialize was a const. So, we had a const. Int special, let's call it. And that was hidden away in private. It would have been illegal to use the constructor style of one or two, cuz that involves assignment. Assignment means we're mutating the value stored in this item. But this is initialization, initialization, much like with the native types, if we have a const int special, and we assign it 5, that means it's going to be 5 throughout the range of that declaration. Throughout the scope of that declaration. We're telling the compiler it can't be modified. Called Cons Correctus, that's a very good thing to do. It helps us and prevents us from writing buggy code. So the same thing is going to be true with an object. Remember, everything in the native language we wanna replicate in building objects. And we may also want to have the ability to have members that are const, and members that are const means that we have to have the ability to initialize them. So, as I say, initialization is preferable to assignment. And only in the constructors, only in the constructors, are you allowed this initializing syntax. Which makes sense cuz that's the constructor's job. The constructor is to build the object and initialize it. Anytime we were to call p, q, and r as a point, all would call the constructor of void signature. Now, of course, you'd have to write that default constructor. We all call it the default constructor. And you would only choose one of those. You can't write all three because you'd have an ambiguity. And they would call instructor the constructor with a void signature. Now, just because you have a void constructor doesn't give you all your opportunities. It's also useful to have multiple ways to initialize objects multiple ways. Let's look at initializing point with this signature. This says I have 2 doubles in my argument list, and the argument name is going to be x. So the arg name is x. But x is going to be assigned to the member. So this is the x that's the argument. And this is the x that's the member. Used to disambiguate. Otherwise I could have said point (double xyz, and then I would not need this disambiguation. I would say xyz =x because I would know that that's the only thing in the range of the method. That x would then have to be the self-referential x. But once I have an argument, that argument name takes precedence over the self-referential name. And the way you disambiguate it is through the use of pointer notation, and of this pointer. So that's very important to keep in mind. Sometimes the use of this pointer is unavoidable. So summarizing, this pointer lets ambiguity be resolved, because x=x wouldn't work. It would just be assign x to the argument x, and nothing would happen to the self-referential object, the x part of the object. But even better would be to use initializing syntax. And the reason why that's better is we don't have the same ambiguity problem. This x and that x are clear and the initializing syntax, this has to be a member And this has to be some expression. Which can be the argument. So, this provides for the disambiguation, automatically. And we can avoid the use of this, they're semantically equivalent.