More Objects Created at Run Time

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.
go to previous page   go to home page   go to next page

Answer:

Add more employees.

More Objects Created at Run Time

boss and additional workers

 

 

Object-oriented programs can create more objects as the program runs. The new objects might be needed to handle additional data that the program needs to work with. The picture shows your business after a few more employees have been added.

Notice that objects (workers) can communicate with each other, not just with main() (the boss). Some objects do not communicate with main() at all, but communicate only with other objects in the system.

QUESTION 5:

(Review:) Can a class decription be used to create more than one object?