How to run multiple consoles from one class?

后端 未结 5 838
一个人的身影
一个人的身影 2021-01-25 06:27

I have three classes which all make different works but I need to run them together. When I run all of them in one class I just get one console and cant change this console. Wha

5条回答
  •  臣服心动
    2021-01-25 07:00

    You could run a server-like application which would accept messages and then display them in the console. The class would start each of your other main methods in new Threads, and then wait indefinitely for messages, ending when the other three threads close.

提交回复
热议问题