Description: A simple example of Java multithreading.
A) Producer production String, and saved in the ArrayList. Consumer consumption (readout and explicit
)String and remove it from the ArrayList. Production and consumption should be printed in the console.
B) can specify how many data producers produce, or how many data consumers can consume. Complete required data
After production or consumption, the thread terminates automatically. (the corresponding constructor should be provided to specify the number of data)
C) when there is no data in the container, Consumer should wait until the container has new data and then start consuming again.
File list (Check if you may need any files):