Exercise 2: Viewing the Methods in Your Project
In this exercise, you will list the methods defined in the Blink class. From this list, you will be able to view the source code for the method. To successfully complete this exercise, you must have completed the previous exercise, Viewing the Class Hierarchy.
- In the Class Browser, scroll down to the Constructors label.
A constructor is a special method that initializes an object when it is created. The Class Browser lists one constructor, Blink, defined inside the Blink class.
- Click Blink.
The Source Editor displays the source code for the constructor Blink. The first line of the constructor is highlighted in purple.
- In the Class Browser, scroll down to the Methods label.
The Blink class contains five methods: init, paint, start, stop, and run.
- Click paint.
The Source Editor displays the source code for the paint method. The first line is highlighted in purple.
Next lesson:
- Exercise 3: Finding Strings in Your Code