Home > Back-end >  Ask everyone a multithreading issues
Ask everyone a multithreading issues

Time:05-27

I have five string
String [] strings=new String [] {" a ", "b", "c", "d", "e"};

Open five threads execute
The ExecutorService ExecutorService=Executors. NewFixedThreadPool (5);


Requirement is that each thread after opening, each string and a string "B", requirement is aB, bB, cB, dB, eB sequentially, each string can only handle one,

The old man have any ideas? Or write it provides how to do it, thank you very much!
  • Related