1 00:00:01,370 --> 00:00:04,580 In this lesson, you will generate getters and setters. 2 00:00:06,330 --> 00:00:12,810 Go to the extension's marketplace, and then there look for the Java code generators extension. 3 00:00:13,170 --> 00:00:16,890 Once you do install it, enable it, do whatever you have to do. 4 00:00:16,920 --> 00:00:19,770 I already have it installed and enabled. 5 00:00:20,220 --> 00:00:24,150 And just to be on the safe side, close your editor and re-open it. 6 00:00:25,720 --> 00:00:26,620 Once you do. 7 00:00:27,710 --> 00:00:34,460 Well, we're going to do is delete all of the getters and setters that we've made so far. 8 00:00:36,460 --> 00:00:44,890 And now we can just right click, say, Java code generators and click on Generate Getters and Setters. 9 00:00:47,980 --> 00:00:53,890 And now you'll notice that when you generate your gutters, it uses this make when you really don't 10 00:00:53,890 --> 00:00:54,550 need to. 11 00:00:55,620 --> 00:01:00,870 Because the purpose of this is to distinguish between the field of the current object that's calling 12 00:01:00,870 --> 00:01:03,990 this method and the parameter that gets passed in. 13 00:01:04,920 --> 00:01:05,310 Here. 14 00:01:05,310 --> 00:01:11,250 If you just say return make, it's automatically going to return the field of the current object calls 15 00:01:11,250 --> 00:01:11,990 get make. 16 00:01:12,000 --> 00:01:17,970 But it's also a good practice to put the this keyword anyway so you can remove the this keyword you 17 00:01:17,970 --> 00:01:18,450 can leave. 18 00:01:18,450 --> 00:01:23,580 It doesn't really matter in this context, but because that's what was generated, we're going to leave 19 00:01:23,580 --> 00:01:23,910 it. 20 00:01:24,510 --> 00:01:31,620 That being said, I am rarely ever going to use the Java code generators extension in this course because 21 00:01:31,620 --> 00:01:35,880 I want you to get used to writing your own getters and setters. 22 00:01:35,880 --> 00:01:37,620 I think it's really good practice. 23 00:01:37,620 --> 00:01:43,740 So this will probably be the last time that you see me using the code generators extension, but if 24 00:01:43,740 --> 00:01:46,890 you really want to use it yourself, then knock yourself out. 25 00:01:47,900 --> 00:01:50,990 In this lesson you generated getters and setters.