Introduction - If you have any usage issues, please Google them yourself
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.
Packet : 91331978produceandconsume.rar filelist
Consumer.java
Main.java
Producer.java
StrArray.java