Hello, in this video we are going to look at accessing attributes from our instance objects, which are these of our class. If you've been following in this series so far, you might be wondering why I'm using different web for too many. Honestly, the only reason is, the other website that I was using was just working load slowly, so often, they just have no load on their servers. So apart from that, there's no particular reason you should be fine with you just like, just now when I went to record, it was just really slow. So for the different one, okay, so again, you can run it locally. So to access, you know, the attribute, this is an act I mean, this is an attribute a variable and this is the method, you use the dot operator for you the instance name, call one dot speak, for example, and let's print it so you can actually and offsets Why not?
03 Point zero because you know it's set to zero initially. So let's see what happens. So what I'm actually going to do is put some extra code in with a call. One. Yeah, like so. I'm going to print it out again, but in between printing the end, we're going to do a do call one.
Increase receipt and remember, we don't need to pass anything yourself. It's only the variable after so be the man toys five. So let's run this. The Reagan era online 12 912 long 12 Let's have a look again, go back to it. So it's a speed for column one cannot concatenate str int objects does not allow us to concatenate them for some reason untied. All about that.
We've actually covered in a separate video in the strings to be more precise, so we get zero and five. Okay, that's pretty cool. You might be thinking, Okay, that's nothing new. And yeah, you're right. That is nothing new. So actually, let me skip Did not concatenate What am I doing?
That needs to be? Great. What you're concatenating and what you'll never you? locker. Okay? Good see problems as well.
What do you think? And I do this car to speed now I get zero so caught in my thinking, we change the speed, you know we increase the by five but that was car one that's the beauty of classic we can have several objects and yes they'll share common functionality in terms of the attributes they have in the way things flow in the class, but at the end of the day they have their own variables. So if I you know change the speed for car one, car two doesn't change. Now that makes sense. If you know we have two cars in real life and call one acceleration cartoon still standing still, you know, they're actually Competition they're different speeds, different acceleration, for example, so it makes sense then have their own attributes on it. That's it for accessing attributes.
Obviously, it's a matter of your more complex. No method, we more prompted you to pass in more parameters. But really this is this is all you need to know is the dot operator. Thanks for watching, and I look forward to seeing you in the next video.