1 00:00:00,180 --> 00:00:01,110 ‫Welcome back. 2 00:00:01,140 --> 00:00:06,610 ‫In this video, we are going to keep on going with properties and setters and getters. 3 00:00:06,630 --> 00:00:11,040 ‫We started off on the last video where we looked at setters and getters and now we're going to use the 4 00:00:11,040 --> 00:00:13,200 ‫same code and we're going to extend it a little bit. 5 00:00:13,200 --> 00:00:21,570 ‫So we saw that we can use setters in order to set the value of a member variable and we can implement 6 00:00:21,570 --> 00:00:24,150 ‫our own logic how we want to set it. 7 00:00:24,150 --> 00:00:30,330 ‫So we can say, okay, if you want to set the value, it has to follow my rules so we can define our 8 00:00:30,330 --> 00:00:33,630 ‫own rules, which have to be. 9 00:00:34,590 --> 00:00:35,310 ‫Followed. 10 00:00:35,580 --> 00:00:39,450 ‫And then we have getters which we can also adjust. 11 00:00:39,450 --> 00:00:45,510 ‫So we can just say, okay, if you want to get the variable I'm going to give you in this case, the 12 00:00:45,510 --> 00:00:52,170 ‫result of the multiplication of length, height and width so you can modify them to your liking. 13 00:00:52,260 --> 00:00:56,430 ‫Now let's have a look at properties and how this is all connected with each other. 14 00:00:56,430 --> 00:01:05,040 ‫So let's create a property and I'm going to create a public property called height, and this height 15 00:01:05,040 --> 00:01:08,370 ‫will adjust my height member variable. 16 00:01:08,370 --> 00:01:10,230 ‫So it was public before. 17 00:01:10,260 --> 00:01:14,910 ‫Now I'm going to make it private so that we cannot access height from outside. 18 00:01:14,910 --> 00:01:18,900 ‫So here, if I want to adjust height, I will not be able to do it any more. 19 00:01:18,930 --> 00:01:20,010 ‫Now I get this error. 20 00:01:20,490 --> 00:01:21,150 ‫All right? 21 00:01:21,180 --> 00:01:28,620 ‫Now let's use our height property in order to still be able to access our height up there. 22 00:01:28,740 --> 00:01:30,170 ‫So how do we do that? 23 00:01:30,180 --> 00:01:37,590 ‫Well, we, first of all, use this property with a capital H at the beginning. 24 00:01:37,590 --> 00:01:40,200 ‫That's generally how you use properties. 25 00:01:40,200 --> 00:01:43,260 ‫That's a convention and C programming. 26 00:01:43,260 --> 00:01:50,820 ‫The properties start with the capital letter and now here I can create my getter and I can return the 27 00:01:50,820 --> 00:01:55,080 ‫height and I can create my setter. 28 00:01:55,380 --> 00:02:02,100 ‫And I can just set the height here to being, for example, the value that is assigned. 29 00:02:02,220 --> 00:02:04,590 ‫Now, what is this value keyword? 30 00:02:04,980 --> 00:02:10,380 ‫Well, what we're doing here is basically the same thing as we did before, where we set length and 31 00:02:10,380 --> 00:02:10,920 ‫get length. 32 00:02:10,920 --> 00:02:15,840 ‫But now our gateway, so to speak, is our property height. 33 00:02:15,840 --> 00:02:23,340 ‫So if you want to access or change the height memorable, you have to do it via the property height. 34 00:02:23,880 --> 00:02:31,350 ‫So now what you can do is you can set it at the value that you set will be set to the height. 35 00:02:31,410 --> 00:02:37,620 ‫Now how does it actually look like when we go to our program now here if we try to set the height? 36 00:02:38,740 --> 00:02:43,090 ‫By accessing the member variable directly, we cannot do it anymore. 37 00:02:43,090 --> 00:02:48,640 ‫But if you access the property, as you can see, the height is available here and it's this tool icon 38 00:02:48,640 --> 00:02:49,660 ‫that we can see here. 39 00:02:49,660 --> 00:02:56,560 ‫So this is generally the icon that you have when you want to access a property and you can see this 40 00:02:56,560 --> 00:02:56,920 ‫works. 41 00:02:56,920 --> 00:03:04,120 ‫So we can set the height now and if we do so, this will or this for here, whatever is behind this 42 00:03:04,120 --> 00:03:11,410 ‫equal sign or after this equals sign, that will be the value here, this value and it will be set as 43 00:03:11,410 --> 00:03:11,950 ‫the height. 44 00:03:11,950 --> 00:03:17,860 ‫So this value is pretty much the same thing as length as we had before when we created this set length. 45 00:03:18,010 --> 00:03:24,550 ‫It's the same concept pretty much, but we it's just a shorter way of doing it, right? 46 00:03:24,550 --> 00:03:28,120 ‫So here you can see if we wanted to have a setter, we had all of this code. 47 00:03:28,120 --> 00:03:29,980 ‫Of course, we didn't need this code here. 48 00:03:30,010 --> 00:03:30,370 ‫All right? 49 00:03:30,370 --> 00:03:34,750 ‫But still, we had all of this code and now we have this super short code. 50 00:03:34,750 --> 00:03:36,100 ‫So this is the setter. 51 00:03:38,080 --> 00:03:40,080 ‫Of course here we can also adjust it. 52 00:03:40,090 --> 00:03:51,880 ‫Now, let's say if value is less than zero, then we will set our height to be minus value and else 53 00:03:53,260 --> 00:03:55,780 ‫it's going to be height, equal value. 54 00:03:57,520 --> 00:04:02,590 ‫Now let's go to our program and I'll set the height to minus four. 55 00:04:04,610 --> 00:04:09,020 ‫And at length that said that before because we created this error before. 56 00:04:09,020 --> 00:04:09,410 ‫Right. 57 00:04:09,410 --> 00:04:14,690 ‫And now let's set the height to minus four and let's run our code. 58 00:04:17,810 --> 00:04:19,070 ‫And we will see that it works. 59 00:04:19,070 --> 00:04:21,980 ‫So length is for height is for width is five. 60 00:04:22,250 --> 00:04:23,450 ‫So why is that? 61 00:04:23,750 --> 00:04:25,540 ‫Even though we set the value to minus four? 62 00:04:25,550 --> 00:04:33,350 ‫Well, we said if the value of the height that you pass to me is negative, then I'm going to multiply 63 00:04:33,350 --> 00:04:33,640 ‫it. 64 00:04:33,650 --> 00:04:36,950 ‫So if the value is less than zero, I'm going to multiply it with minus one. 65 00:04:36,950 --> 00:04:38,570 ‫So I'm gonna make it positive again. 66 00:04:38,570 --> 00:04:42,110 ‫And if it's positive, then just make it or assign the value. 67 00:04:42,140 --> 00:04:44,450 ‫Or if it's zero, it's fine as well. 68 00:04:45,050 --> 00:04:45,380 ‫All right. 69 00:04:45,380 --> 00:04:49,560 ‫So that is what we can do with properties. 70 00:04:49,580 --> 00:04:52,750 ‫Now, this is an implementation of a property. 71 00:04:52,760 --> 00:04:59,470 ‫Of course, what you can do is you can also just use the property without having a member variable. 72 00:04:59,480 --> 00:05:04,940 ‫So this member variable that we have here could be something that is not required whatsoever. 73 00:05:04,940 --> 00:05:06,560 ‫So we could just even skip that. 74 00:05:06,560 --> 00:05:15,920 ‫So let's say I don't want to set the width as a member variable, I want to have it as a property. 75 00:05:16,220 --> 00:05:18,800 ‫And now I'm going to show you another way to create a property. 76 00:05:18,800 --> 00:05:20,900 ‫And this is a lot, lot faster. 77 00:05:20,900 --> 00:05:29,240 ‫So you just use P, R, o, p, and then you double tap and this will create this property for you. 78 00:05:29,240 --> 00:05:33,020 ‫Now you just can enter the type and I'm going to say, okay, it's going to be an integer. 79 00:05:33,020 --> 00:05:36,020 ‫Then you press tab again and now you can give it a name. 80 00:05:36,020 --> 00:05:38,300 ‫So I'm going to call this one width. 81 00:05:39,050 --> 00:05:40,850 ‫Now what is going on here? 82 00:05:41,060 --> 00:05:50,360 ‫Well, this is a code that is just understood by C sharp and it even was created for us automatically 83 00:05:50,360 --> 00:05:51,200 ‫with our ID. 84 00:05:51,230 --> 00:05:51,800 ‫Right. 85 00:05:51,860 --> 00:05:55,520 ‫It just says get semicolon set semicolon. 86 00:05:55,520 --> 00:06:02,090 ‫So this just means that it's just going to be a default getter and a default setter, which just means, 87 00:06:02,120 --> 00:06:10,310 ‫okay, if you want to access width, you can just access it by using the width variable this property. 88 00:06:10,310 --> 00:06:12,260 ‫And if you want to set it, you can also just use it. 89 00:06:12,260 --> 00:06:14,390 ‫So what does it mean in our case? 90 00:06:14,390 --> 00:06:20,270 ‫Well, it means that now we can access this property by just assigning a value. 91 00:06:20,540 --> 00:06:23,030 ‫And if we want to write it out. 92 00:06:23,030 --> 00:06:32,510 ‫So if we want to access it, boxes with is box dot. 93 00:06:33,500 --> 00:06:34,160 ‫With. 94 00:06:35,030 --> 00:06:37,610 ‫So here we can access the property directly. 95 00:06:38,150 --> 00:06:38,780 ‫All right. 96 00:06:38,900 --> 00:06:40,670 ‫So this is the difference here. 97 00:06:42,070 --> 00:06:46,870 ‫So internally it's the same thing as if we created. 98 00:06:48,420 --> 00:06:49,110 ‫The. 99 00:06:50,010 --> 00:06:50,370 ‫With. 100 00:06:50,400 --> 00:06:54,410 ‫Let's get back to this with let's have this member variable again. 101 00:06:54,420 --> 00:07:01,830 ‫So internally it's the same thing as if I created this public end with and I'm going to comment this 102 00:07:01,830 --> 00:07:09,570 ‫out for now and I have a getter so get I return the width. 103 00:07:11,680 --> 00:07:13,810 ‫Or this dot with. 104 00:07:17,450 --> 00:07:24,920 ‫And the setter where I said they start with with value. 105 00:07:25,730 --> 00:07:26,030 ‫All right. 106 00:07:26,030 --> 00:07:27,020 ‫So this is really. 107 00:07:28,000 --> 00:07:28,570 ‫This. 108 00:07:29,560 --> 00:07:33,700 ‫Code here is really just the same thing as this one. 109 00:07:33,700 --> 00:07:37,450 ‫And internally, it's also what happens once you compile the code. 110 00:07:37,450 --> 00:07:40,600 ‫So the compiler does that automatically. 111 00:07:40,600 --> 00:07:46,150 ‫For us it just says, okay, if you have this line of code, I'm going to internally treat it as if 112 00:07:46,150 --> 00:07:51,910 ‫it was this code that you have here, only that it's a lot shorter and it's a lot easier to create this 113 00:07:51,910 --> 00:07:52,420 ‫code. 114 00:07:53,170 --> 00:07:53,800 ‫All right. 115 00:07:55,370 --> 00:08:00,680 ‫So I'm just going to comment this out because I really like this short approach that we have there, 116 00:08:01,520 --> 00:08:05,420 ‫and let's comment this out like this. 117 00:08:06,700 --> 00:08:10,780 ‫And I don't need this member variable anymore. 118 00:08:11,170 --> 00:08:11,470 ‫All right. 119 00:08:11,470 --> 00:08:17,530 ‫Because here we needed to remember variable because I set the width and in this case, I set the member 120 00:08:17,530 --> 00:08:18,350 ‫variable width. 121 00:08:18,370 --> 00:08:19,660 ‫I didn't set the. 122 00:08:20,630 --> 00:08:23,830 ‫I cannot cannot set the width itself. 123 00:08:23,830 --> 00:08:26,590 ‫So if I instead here would write with. 124 00:08:27,500 --> 00:08:32,990 ‫And with if I now do that, what I create as a StackOverflow. 125 00:08:32,990 --> 00:08:40,390 ‫So I constantly try to set something and it's going to be an endless loop here, which is not good. 126 00:08:40,400 --> 00:08:44,790 ‫That's why I needed to remember variable for this example here. 127 00:08:44,810 --> 00:08:45,200 ‫All right. 128 00:08:45,200 --> 00:08:47,990 ‫But internally, it's going to treat it like this, like that. 129 00:08:48,440 --> 00:08:51,740 ‫So it's internally treating it like the code that we have here. 130 00:08:51,980 --> 00:08:54,110 ‫Only that it's a lot shorter for us. 131 00:08:56,280 --> 00:08:56,940 ‫All right. 132 00:08:56,940 --> 00:08:59,340 ‫So now a little challenge for you. 133 00:08:59,700 --> 00:09:08,730 ‫Please go ahead and create a property for volume which surrounds it like we did with the width here. 134 00:09:08,760 --> 00:09:09,270 ‫All right. 135 00:09:09,270 --> 00:09:16,560 ‫So pretty much the same example that we had here, only that it's going to adjust the volume and not 136 00:09:16,560 --> 00:09:17,090 ‫the width. 137 00:09:17,100 --> 00:09:18,090 ‫So please try that. 138 00:09:18,090 --> 00:09:20,580 ‫Create your own property, type it out. 139 00:09:20,850 --> 00:09:23,280 ‫Don't make the short approach or use a short approach. 140 00:09:24,240 --> 00:09:24,630 ‫All right. 141 00:09:24,630 --> 00:09:31,500 ‫So for this to make sense, we first of all have to make our volume private and then we can create a 142 00:09:31,500 --> 00:09:32,550 ‫property for our volume. 143 00:09:32,550 --> 00:09:40,440 ‫So public int volume with a capital V is going to be get. 144 00:09:42,360 --> 00:09:47,040 ‫Return volume and then set. 145 00:09:49,020 --> 00:09:52,200 ‫This start volume is equal to. 146 00:09:53,400 --> 00:09:54,090 ‫Value. 147 00:09:55,850 --> 00:10:00,710 ‫So this is the property that we created for the volume. 148 00:10:01,070 --> 00:10:02,930 ‫I hope you were able to do so. 149 00:10:02,960 --> 00:10:08,660 ‫Of course, you just could have gotten rid of this volume altogether and created it the same way that 150 00:10:08,660 --> 00:10:09,800 ‫we did with the width. 151 00:10:09,800 --> 00:10:14,360 ‫It's a lot quicker, but I just wanted to show you that this is all so cool. 152 00:10:14,390 --> 00:10:15,530 ‫Now, the. 153 00:10:16,730 --> 00:10:25,870 ‫Important part hereby is that we can think about the volume variable or this property and why, or at 154 00:10:25,870 --> 00:10:31,720 ‫which point does it make sense to change it or get it? 155 00:10:31,720 --> 00:10:34,630 ‫Does it even make sense to do both of them? 156 00:10:34,750 --> 00:10:42,250 ‫Because the volume is something that is calculated based on the width and height and length. 157 00:10:42,670 --> 00:10:47,170 ‫Now, does it make sense to set the volume directly? 158 00:10:47,410 --> 00:10:48,790 ‫Well, no, I would say so. 159 00:10:48,790 --> 00:10:54,250 ‫I think setting the volume doesn't even make sense at all so we could get rid of this whole setter and 160 00:10:54,250 --> 00:10:55,390 ‫only have a getter. 161 00:10:55,810 --> 00:11:00,610 ‫Now, the volume itself, we never set the volume. 162 00:11:00,610 --> 00:11:01,840 ‫It's always calculated. 163 00:11:01,840 --> 00:11:04,600 ‫So does it make sense to just return the volume? 164 00:11:04,810 --> 00:11:11,800 ‫Well, it really doesn't, because actually what we should do is here at this point, we should calculate 165 00:11:11,800 --> 00:11:20,980 ‫that the volume is going to be the multiplication of length, height and width, you see. 166 00:11:21,010 --> 00:11:24,640 ‫So now it's a lot more meaningful. 167 00:11:24,640 --> 00:11:27,610 ‫So what we return with the volume is a lot more meaningful. 168 00:11:27,610 --> 00:11:30,640 ‫If somebody wants to get the volume, that's what they're getting. 169 00:11:32,050 --> 00:11:40,240 ‫Now, of course, we created a little bug here at the bottom or some get volume methods that we don't 170 00:11:40,240 --> 00:11:41,110 ‫need anymore. 171 00:11:41,470 --> 00:11:45,470 ‫And at the same time here, the width now is the property that we access. 172 00:11:45,490 --> 00:11:48,130 ‫It's not going to be the. 173 00:11:49,360 --> 00:11:51,730 ‫Remember variable anymore because we don't have it anymore. 174 00:11:53,450 --> 00:11:58,010 ‫And of course, in our program CSS, we can now also adjust everything. 175 00:11:58,010 --> 00:12:06,920 ‫So now we can access the width directly and we can access the volume property directly and not the volume 176 00:12:06,920 --> 00:12:08,270 ‫member variable anymore. 177 00:12:09,170 --> 00:12:09,890 ‫All right. 178 00:12:09,890 --> 00:12:14,750 ‫So now let's do a final step here. 179 00:12:16,680 --> 00:12:20,940 ‫And that is to add a constructor. 180 00:12:21,270 --> 00:12:22,300 ‫So public. 181 00:12:22,320 --> 00:12:23,160 ‫Box. 182 00:12:24,420 --> 00:12:27,210 ‫INT length. 183 00:12:27,740 --> 00:12:28,470 ‫INT. 184 00:12:28,800 --> 00:12:30,270 ‫Height and end. 185 00:12:30,270 --> 00:12:30,870 ‫Width. 186 00:12:30,960 --> 00:12:36,900 ‫So now if we create a box, I want to have all of those values and the length that is given to me once 187 00:12:36,900 --> 00:12:41,000 ‫the box is created should be this dot length. 188 00:12:41,010 --> 00:12:46,830 ‫Then the height that is given, this dot height should be the height. 189 00:12:47,310 --> 00:12:54,840 ‫So the height that is given this one should be the height that we have here, which is our member variable. 190 00:12:55,170 --> 00:13:01,710 ‫And our width is the final one and this is the property. 191 00:13:01,710 --> 00:13:04,980 ‫So we set it to the width that is given to us. 192 00:13:05,430 --> 00:13:09,660 ‫Now, in this case, you might of course omit this, this keyword. 193 00:13:09,660 --> 00:13:15,840 ‫You can just say width, because it's also obvious that we are talking about the property of this class. 194 00:13:15,840 --> 00:13:18,300 ‫So you don't need this this keyword here. 195 00:13:18,330 --> 00:13:23,900 ‫Now, an important thing that somebody asked and I wanted to really make this clear. 196 00:13:23,910 --> 00:13:31,230 ‫So this dot length, equal length works, but length is equal to this dot length does not make sense. 197 00:13:31,230 --> 00:13:39,630 ‫So this line here does not make sense because length is this part here, which is really just the parameter 198 00:13:39,630 --> 00:13:41,730 ‫and it's the value that is given to us. 199 00:13:41,730 --> 00:13:49,080 ‫So we don't want to adjust the value that is given to us, but we want to set the value of our property 200 00:13:49,080 --> 00:13:52,470 ‫or of our member variable, and that's what we do here. 201 00:13:52,470 --> 00:13:55,080 ‫So in this case, that's what we do. 202 00:13:55,080 --> 00:13:59,670 ‫We set the value of our member variable. 203 00:14:02,000 --> 00:14:03,950 ‫All right, now let's use this box. 204 00:14:03,980 --> 00:14:07,610 ‫Let's create boxes now, because now we don't need to do all of that anymore. 205 00:14:07,610 --> 00:14:15,470 ‫We don't need to set the values directly anymore, but we can set them in the creation of our box. 206 00:14:15,470 --> 00:14:17,810 ‫So I'm just going to assign values three, four and five. 207 00:14:17,810 --> 00:14:18,680 ‫So the length is three. 208 00:14:18,680 --> 00:14:22,220 ‫The height or actually the height is four into width is five. 209 00:14:22,730 --> 00:14:29,690 ‫And now if we run this, it will display the width and the volume for us. 210 00:14:29,810 --> 00:14:31,190 ‫So there you are with this. 211 00:14:31,190 --> 00:14:32,630 ‫Five volume is 60. 212 00:14:32,960 --> 00:14:33,320 ‫All right. 213 00:14:33,320 --> 00:14:34,040 ‫That seems to work. 214 00:14:34,040 --> 00:14:41,810 ‫Now, what we can do is we can set the width by accessing our property. 215 00:14:41,840 --> 00:14:47,300 ‫Let's say we set the width to ten now and we run this code again. 216 00:14:50,180 --> 00:14:57,050 ‫And with the split with once again so we can see that the default value that was given is printed and 217 00:14:57,050 --> 00:14:58,850 ‫then the new value that we set. 218 00:14:58,850 --> 00:15:04,610 ‫So we set width to ten and now it says the width and it's calculating the width accordingly. 219 00:15:04,610 --> 00:15:07,490 ‫So three times, four times ten is one on 20. 220 00:15:08,910 --> 00:15:10,200 ‫It's the new volume. 221 00:15:10,620 --> 00:15:11,100 ‫All right. 222 00:15:11,100 --> 00:15:12,210 ‫Summoning it up. 223 00:15:12,630 --> 00:15:18,270 ‫So what we did is we created, first of all, a bunch of member variables. 224 00:15:19,140 --> 00:15:25,320 ‫We made them private so that no one except for this class itself can access them directly. 225 00:15:25,770 --> 00:15:29,910 ‫So no other class can access them directly. 226 00:15:30,060 --> 00:15:36,840 ‫They can only access them via our properties that we created or via our setters and getters. 227 00:15:36,840 --> 00:15:39,340 ‫So we have the set length that get length. 228 00:15:39,360 --> 00:15:46,350 ‫So if anybody wants to access the length variable, they have to go the way of using set length and 229 00:15:46,350 --> 00:15:47,130 ‫get length. 230 00:15:48,120 --> 00:15:51,150 ‫This is a totally valid approach and you will see that. 231 00:15:51,150 --> 00:15:58,400 ‫And yeah, with those approaches you can define the logic that you want to be followed. 232 00:15:58,410 --> 00:16:03,210 ‫If somebody wants to, for example, set a variable or if they want to get a variable. 233 00:16:03,540 --> 00:16:07,980 ‫Now another way of doing it is to directly use a property. 234 00:16:07,980 --> 00:16:14,640 ‫So if you use a property, you need to call it with a capital letter and then you can implement a getter 235 00:16:14,640 --> 00:16:20,700 ‫and etc. but you can also just decide to either only implement a getter or only implement the setter. 236 00:16:20,730 --> 00:16:24,780 ‫We're not, of course, implementing both of them here. 237 00:16:24,780 --> 00:16:26,490 ‫You can also set the. 238 00:16:27,530 --> 00:16:32,480 ‫Values directly, so you can either set the member variables. 239 00:16:32,480 --> 00:16:34,370 ‫So this is what we did here by. 240 00:16:35,350 --> 00:16:44,890 ‫So to speak, adding a gateway called Height, which is our property to our height that we created here 241 00:16:44,890 --> 00:16:47,620 ‫at the top, which is our member variable. 242 00:16:48,340 --> 00:16:55,480 ‫Or we just went the direct route where we just said, okay, we will directly have a very simple auto 243 00:16:55,480 --> 00:17:03,220 ‫implemented property here and we don't need to have an extra member variable for it. 244 00:17:03,340 --> 00:17:07,930 ‫We could have gone the whole way for all of those variables to only have properties. 245 00:17:07,930 --> 00:17:10,180 ‫So we could have made it very simple. 246 00:17:10,180 --> 00:17:13,000 ‫But just having three properties like. 247 00:17:14,570 --> 00:17:14,840 ‫This. 248 00:17:14,900 --> 00:17:23,780 ‫So getting rid of all of that and just have a public or apr0p double tap and, and this would be then 249 00:17:23,780 --> 00:17:28,700 ‫the length would be just get set and then the same thing for the height and so forth. 250 00:17:29,090 --> 00:17:34,340 ‫But I just wanted to show you all of the different ways that there are and all of the different ways 251 00:17:34,340 --> 00:17:35,300 ‫that you will see. 252 00:17:35,420 --> 00:17:41,120 ‫And most of the times when you see something or when you use properties, you will see them most of 253 00:17:41,120 --> 00:17:41,930 ‫the time like this. 254 00:17:41,930 --> 00:17:48,050 ‫So with the other implemented property, what is the easiest and fastest way? 255 00:17:49,400 --> 00:17:53,660 ‫You will not need to use all of the different approaches that I showed you that is really important. 256 00:17:53,670 --> 00:17:59,540 ‫You will not need to use all of the different structures, but in some cases you will need to implement 257 00:17:59,540 --> 00:18:00,140 ‫the setter. 258 00:18:00,140 --> 00:18:05,570 ‫In some cases you need to implement the specific getter, and now you know how to do it. 259 00:18:05,900 --> 00:18:11,830 ‫So in short, if you have any questions, why would you need this approach? 260 00:18:11,840 --> 00:18:19,460 ‫Well, they are just used when you have no additional logic required in the property assessors. 261 00:18:19,460 --> 00:18:22,620 ‫So in the property definitions and yeah. 262 00:18:22,910 --> 00:18:24,080 ‫Getters and setters.