Objects

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:

As many as are needed. A class is a pattern that can be followed an unlimited number of times.

Objects

Ford and Automobile objects

 

The picture shows a parent class and a child class, and some objects that have been constructed from each. These objects are shown as rectangles (to convey the idea that they are more real than the classes, which are only designs).

In the picture, "Joe's car," "Mary's Ford," and "Bob's Ford" represent actual objects. The cloudy classes represent designs, not actual objects.

Objects are constructed as a program runs. An object is constructed by following a description in a class file, the result of compiling a Java source program.

QUESTION 6:

  • How many types of automobile are there in the diagram?
  • How many automobile objects are there in the diagram?