下面哪些方法可用于创建一个可运行的多线程类?()
A: publicclassTimplementsRunable{publicvoidrun(){…}}
B: publicclassTextendsThread{publicvoidrun(){…}}
C: publicclassTimplementsThread{publicvoidrun(){…}}
D: publicclassTimplementsThread{publicintrun(){….}}
E: publicclassTimplementsRunable{protectedvoidrun(){…}}
A: publicclassTimplementsRunable{publicvoidrun(){…}}
B: publicclassTextendsThread{publicvoidrun(){…}}
C: publicclassTimplementsThread{publicvoidrun(){…}}
D: publicclassTimplementsThread{publicintrun(){….}}
E: publicclassTimplementsRunable{protectedvoidrun(){…}}
举一反三
- 下列哪个方法可用于创建一个可运行的类 A: publicclassXimplementsRunable{publicvoidrun(){......}} B: publicclassXimplementsThread{publicvoidrun(){......}} C: publicclassXimplementsThread{publicintrun(){......}} D: publicclassXimplementsRunable{protectedvoidrun(){......}}
- 以下C#代码中,关于虚方法和抽象方法使用正确的是() A: publicabstractclassAnimal{publicAnimal(){}}publicabstractvoidRun():Animal{publicCat(){}publicvoidRun(){}} B: publicclassAnimal{publicAnimal(){}}publicabstractvoidRun():Animal{publicCat(){}publicvoidRun(){}} C: publicabstractclassAnimal{publicAnimal(){}publicabstractvoidRun();}publicclasscat:Animal{publicCat(){}publicoverridevoidRun(){}} D: publicvirtualclassAnimal{publicAnimal(){}publicvirtualvoidRun();}publicclasscat:Animal{publicCat(){}publicoverridevoidRun(){}}
- 下列关于Test类的定义中,正确的是()。 A: classTestimplementsRunnable{publicvoidrun{}DublicvoidsomeMethod[]{}} B: classTestimplementsRunnable(puIblicvoidrun;} C: classTestimplementsRunnable(DublicvoidsomeMethod[];} D: classTestimplementsRunnable(publicvoidsomeMethod{}}
- 程序员想要创建一个名为MyThread的类以便在main方法中用Thread实例化。对于下面三行:MyThread必须继承Thread。MyThread必须实现Thread。MyThread必须覆盖publicvoidrun()。有几行是正确的() A.0 B.1 C.2 D.3
- A046阅读下面程序publicclassTest2___________{publicstaticvoidmain(String[]args){Threadt=newTest2(); t.start();}publicvoidrun(){System.out.println(“Howareyou.”);}}在程序下划线处填入正确选项是()(1.0分)