|
What (in general) needs to be done to a Circle object so that it will draw another circle in another location? A good answer might be:Different values need to be stored in the object's variables. | |
Data Access MethodHere is the Circle class with two new methods. The setPosition() method will be used to change the location of a circle. The setRadius() method will be used to change the radius of a circle. Such methods are called access methods because they access the data of an object. Well-designed classes allow access to their data only through access methods. To enforce this, the variables of a class are often made private.
| |
QUESTION 9:Complete the methods by filling in the blanks. Click Here after you have answered the question |