From the course: Learning NetBeans

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

Refactoring: Variables and methods

Refactoring: Variables and methods

From the course: Learning NetBeans

Start my 1-month free trial

Refactoring: Variables and methods

- [Instructor] Sometimes you need to change your code around to make it more, not only just efficient but easier to read and that might mean renaming some variables and moving some methods around but unfortunately because they might have some dependencies on other variables or other methods, it becomes a bit of a headache to do so and that's where refactoring comes into play. Refactoring let's you manipulate your code to make it a little bit more readable while taking care of the dependencies without you having to deal with that yourself. Let's take a look through an example. Let's start off by creating an artist class. And to do that we want to go to our projects file and right click over here on working with clean code, choose new and select java class. And this will be an artist, we don't know what type of artist it could be a comedian, musician, actor, whatever. Now within this class, we're going to have one simple property and it's the name. Let's save that and hop on over to our…

Contents