[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"$fxU1dDxVTD2ocZIrwINsMbp-EmNdBo0VIcQtW-son3G4":3},{"answer":4,"createTime":5,"id":6,"options":7,"origin":13,"question":20,"related":21,"source":31,"type":32},[],"2025-06-15 19:22:42",199210100,[8,9,10,11,12],"sleep(long)","start()","run()","join()","setPriority(int)",{"count":14,"courseId":15,"courseImg":16,"courseName":17,"workId":18,"workName":19},40,"53e1d2ef4961cca8eea3e23969ad2cb9","https:\u002F\u002Ftihai-oss-cloud.itihey.com\u002Fimg\u002F03a579384a6dc297c89809b582fcc767.png","默认课程","work_43584581","多线程概念题20230526183406","java.lang.Thread的________ 方法是静态的",[22,33,42,51,61,70,79,82,91,97],{"answer":23,"createTime":5,"id":24,"options":25,"question":30,"source":31,"type":32},[],199210094,[26,27,28,29],"该程序编译并运行,并显示test","该程序编译并运行,什么也不显示","该程序有一个编译错误,因为在main()方法和构造函数Test()中都定义了t","该程序可以正常编译,但无法运行,因为不能在构造函数中使用关键字this","分析代码:public class Test implements Runnable { public static void main(String[] args) { Test t = new Test(); } public Test() { Thread t = new Thread(this); t.start(); } public void run() { System.out.println(&quot;test&quot;); }}","v1",0,{"answer":34,"createTime":5,"id":35,"options":36,"question":41,"source":31,"type":32},[],199210095,[37,38,39,40],"程序显示test两次","程序显示test一次","一个java.lang.IllegalThreadStateException异常被抛出,因为您刚刚启动线程,并且在再次启动线程之前线程可能尚未完成","没有任何显示","运行下列程序时,会发生________ ?public class Test extends Thread { public static void main(String[] args) { Test t = new Test(); t.start(); t.start(); } public void run() { System.out.println(&quot;test&quot;); }}",{"answer":43,"createTime":5,"id":44,"options":45,"question":50,"source":31,"type":32},[],199210096,[46,47,48,49],"condition.waiting()","condition.waited()","condition.await()","condition.wait()","应在条件上调用_________ 方法使当前线程等待,直到发出条件信号为止",{"answer":52,"createTime":53,"id":54,"options":55,"question":60,"source":31,"type":32},[],"2025-06-12 15:20:13",199210097,[56,57,58,59],"ExecutorService executor = Executors.newFixedThreadPool(1); executor.execute(task1); executor.execute(task2); executor.execute(task3)","ExecutorService executor = Executors.newFixedThreadPool(2); executor.execute(task1); executor.execute(task2); executor.execute(task3)","ExecutorService executor = Executors.newFixedThreadPool(3); executor.execute(task1); executor.execute(task2); executor.execute(task3)","new Thread(task1).start(); new Thread(task2).start(); new Thread(task3).start()","假设有三个可运行任务,task1,task2,task3. 如何在具有2个固定线程的线程池中运行它们",{"answer":62,"createTime":5,"id":63,"options":64,"question":69,"source":31,"type":32},[],199210098,[65,66,67,68],"condition.wakeAll()","condition.signalAll()","condition.wake()","condition.signal()","应在条件上调用_________ 方法唤醒所有等待的线程",{"answer":71,"createTime":5,"id":72,"options":73,"question":78,"source":31,"type":32},[],199210099,[74,75,76,77],"在对象上调用notify()方法时,如果没有线程在等待对象,则会发生异常","调用wait()时,它将暂停线程并同时释放对象上的锁. 在收到通知后重新启动线程时,将自动重新获得锁","必须从同步方法或同步块中调用wait(),notify()和notifyAll()方法","notify()方法只能唤醒一个等待的线程","下面关于内置监视器的陈述,错误的是_________",{"answer":80,"createTime":5,"id":6,"options":81,"question":20,"source":31,"type":32},[],[8,9,10,11,12],{"answer":83,"createTime":53,"id":84,"options":85,"question":90,"source":31,"type":32},[],199210101,[86,87,88,89],"ExecutorService executor = Executors.newCachedThreadPool()","ExecutorService executor = Executors.newCachedThreadPool(2)","ExecutorService executor = Executors.newCachedThreadPool(1)","ExecutorService executor = Executors.newCachedThreadPool(3)","如何创建缓存的线程池",{"answer":92,"createTime":53,"id":93,"options":94,"question":96,"source":31,"type":32},[],199210102,[10,9,8,12,95],"yield()","Thread类的________ 方法抛出InterruptedException异常",{"answer":98,"createTime":5,"id":99,"options":100,"question":105,"source":31,"type":32},[],199210103,[101,102,103,104],"字符a和b随机打印","aaaabbbb","abababab","bbbbaaaa","下列代码的输出结果是_________ ?public class Test { public static void main(String[] args) { new Test(); } public Test() { PrintChar printA = new PrintChar('a', 4); PrintChar printB = new PrintChar('b', 4); printA.run(); printB.run(); } class PrintChar implements Runnable { private char charToPrint; \u002F\u002F The character to print private int times; \u002F\u002F The times to repeat public PrintChar(char c, int t) { charToPrint = c; times = t; } public void run() { for (int i = 0; i &lt; times; i++) System.out.print(charToPrint); } }}"]