Start on the Circle Class

Classic programmed-learning exercises, refreshed for modern Java and presented in the current MrStyner.com portfolio style.

Modern Java noteThis archive has been refreshed for Java 25 LTS. Core language concepts remain useful, while outdated setup instructions and browser-era Java are labeled or replaced. Java 26 is the current feature release; Java 25 is used here as the stable teaching baseline.

Answer:

If the circle moves or changes size, or is added or deleted as the program runs, then it should be a software object.

Start on the Circle Class

If the circles are expected to move as the program executes, then each one should be an object. For example, if the circles represent playing pieces in a game each one should be an object so that it can be moved or removed from play.

class Circle
{
  // variables



  // constructors


  // methods


}

So our Circle will be a drawing tool. The circles drawn in the picture will merely be the traces left behind each time the tool is used. A start on the class is at the left.

Let us think about the variables that a Circle needs.

QUESTION 3:

At a minimum, what variables are needed for a circle?