First, you create a Worker object and pass it the URL of the script that will be executed in the new thread.
首先,您创建一个Worker对象并向它传递将在新线程中执行的脚本的URL。
The new thread reads the message from the socket and USES the resulting String to build a message object.
这个新线程从套接字中读取消息,并使用结果String来构建Message对象。
In the constructor of StockQuoteGenerator class, which is a singleton class, we are starting a new thread and assigning a Runnable object to that thread.
在stockquotegenerator类(一个单态类)的构造函数中,我们启动了一个新线程,并向该线程分配了一个Runnable对象。
应用推荐