From the course: Java Object-Oriented Programming

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Exploring a built-in Java class

Exploring a built-in Java class - Java Tutorial

From the course: Java Object-Oriented Programming

Exploring a built-in Java class

- [Instructor] Now that we have a good understanding of classes and instances, we'll explore the implementation of a built in Java class. One class we've already seen is the color class. We used it by importing Java dot EWT dot color into our tree class and had color represent the color of our tree trunk. While we could look at the documentation to learn more about the color class, one of my favorite tips is to use an IDE to click into the class. I'm using the IntelliJ IDE to write my Java code but there are many other IDEs that also support this feature. To see the source code of the color class, we can command click into the class and go right to the source. This class has around 1200 lines of code including the comments, but let's take a look around and see what concepts we recognize. The color class has a few static attributes or class attributes. These attributes allow us to easily set a default color for a given variable. Just like we used our trunk color in a previous lesson…

Contents