In this lesson, you will generate getters and setters.
Go to the extension's marketplace, and then there look for the Java code generators extension.
Once you do install it, enable it, do whatever you have to do.
I already have it installed and enabled.
And just to be on the safe side, close your editor and re-open it.
Once you do.
Well, we're going to do is delete all of the getters and setters that we've made so far.
And now we can just right click, say, Java code generators and click on Generate Getters and Setters.
And now you'll notice that when you generate your gutters, it uses this make when you really don't
need to.
Because the purpose of this is to distinguish between the field of the current object that's calling
this method and the parameter that gets passed in.
Here.
If you just say return make, it's automatically going to return the field of the current object calls
get make.
But it's also a good practice to put the this keyword anyway so you can remove the this keyword you
can leave.
It doesn't really matter in this context, but because that's what was generated, we're going to leave
it.
That being said, I am rarely ever going to use the Java code generators extension in this course because
I want you to get used to writing your own getters and setters.
I think it's really good practice.
So this will probably be the last time that you see me using the code generators extension, but if
you really want to use it yourself, then knock yourself out.
In this lesson you generated getters and setters.