单选题

下列代码执行结果为(A) public static void main(...

发布于 2022-05-23 17:27:20

下列代码执行结果为(A)

public static void main(String args[])throws InterruptedException{

            Thread t=new Thread(new Runnable() {

                public void run() {

                    try {

                        Thread.sleep(2000)

                    } catch (InterruptedException e) {

                        throw new RuntimeException(e)

                    }

                    System.out.print("2")

                }

            })

            t.start()

             

            t.join()

            System.out.print("1")

        }


登录后免费查看答案
关注者
0
被浏览
25
知识点
面圈网VIP题库

面圈网VIP题库全新上线,海量真题题库资源。 90大类考试,超10万份考试真题开放下载啦

去下载看看