How to start anonymous thread class

前端 未结 8 751
清歌不尽
清歌不尽 2020-12-04 15:37

I have the following code snippet:

public class A {
    public static void main(String[] arg) {
        new Thread() {
            public void run() {
               


        
8条回答
  •  一生所求
    2020-12-04 15:49

    Just call start()

    new Thread()
    {
        public void run() {
            System.out.println("blah");
        }
    }.start();
    

提交回复
热议问题