niusouti.com

classWorkimplementsRunnable{Threadother;Work(Threadother){this.other=other;}publicvoidrun(){try{other.join();}catch(Exceptione){}System.out.print("afterjoin");}}classLaunch{publicstaticvoidmain(String[]args){newThread(newWork(Thread.currentThread())).star

题目

classWorkimplementsRunnable{Threadother;Work(Threadother){this.other=other;}publicvoidrun(){try{other.join();}catch(Exceptione){}System.out.print("afterjoin");}}classLaunch{publicstaticvoidmain(String[]args){newThread(newWork(Thread.currentThread())).start();System.out.print("afterstart");}}结果为:()

A.afterjoin

B.afterstart

C.afterjoinafterstart

D.afterstartafterjoin


相似考题
更多“classWorkimplementsRunnable{Threadother;Work(Threadother){this.other=other;}publicvoidrun( ”相关问题
  • 第1题:

    针对下列程序段,需要( )个测试用例才可以满足语句覆盖的要求。
    switch(value){case 0:other=30;break;case 1:other=50;break;case 2:other=300;case 3:other=other/value;break;default:other=other*value;}

    A.2
    B.3
    C.4
    D.5

    答案:C
    解析:
    本题考查白盒测试用例设计方法--语句覆盖法的概念。语句覆盖(Statement Coverage)的含义是:选择足够多的测试数据,使被测程序中的每条语句至少执行一次。

  • 第2题:

    1、针对下列程序段,需要()个测试用例才可以满足语句覆盖的要求。 switch (value ) { case 0: other = 30; break; case 1: other = 50; break; case 2: other = 300; case 3: other = other/value; break; default: other = other * value; }

    A.2

    B.3

    C.4

    D.5


    4

  • 第3题:

    若有以下说明和语句,则引用方式不正确的是? struct worker{ int no; char *name; }work, *p=&work;

    A.work.no

    B.(*p).no

    C.p->no

    D.work->no


    D

  • 第4题:

    下列哪些工程名是合法的()。

    A.work_2

    B.work2

    C.2work

    D.work2_


    本题答案:A

  • 第5题:

    2、若有以下说明和语句,则引用方式不正确的是? struct worker{ int no; char *name; }work, *p=&work;

    A.work.no

    B.(*p).no

    C.p->no

    D.work->no


    work->no