Java run static method in new thread
•
Java
I just started learning Java, and I encountered a slight obstacle involving threads I have a static method. I want to run it in my own thread. Is this possible? In Python, I know it looks like this:
Solution
Let the run method of thread call the static method:
new Thread(new Runnable() { public void run() { Call.yourStaticMethod(); } }).start();
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码