网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
C语言编程:编写线程测试程序test thread,要求给出编辑命令,程序源码,编译命令,运行结果
参考答案和解析
dseg segmenttestone db?testtwo db?dseg endscseg segmentmain proc farassume cs: cseg, ds: dseg, es: dseg start: push ds sub ax,ax push ax mov ax,dseg mov ds,ax mov es,ax begin: mov al,testone cmp al,testtwo je callsame call notsame jmp continx callsame: call allsame continx: ret main endp allsame proc near mov dl, '#' mov ah,2 int 21h ret allsame endp notsame proc near mov dl, '!' mov ah,2 int 21h ret notsame endp cseg ends end start
更多 “C语言编程:编写线程测试程序test thread,要求给出编辑命令,程序源码,编译命令,运行结果” 相关考题
考题
阅读下列程序:class ThreadTest extends Thread{ public static void main(String[]args){ Thread t=new Thread(this); t.start(); } public void run(){ System.out.print("A thread test."); }} 对该程序而言,正确结论是 ( )A.该程序能够通过编译并打印输出“A thread test.”B.该程序能够通过编译,但运行时将不调用ThreadTest类中的run()方法,因此不产生任何输出C.该程序存在编译错误,因为在main()方法中不能使用this指针D.上述选项都不正确
考题
单选题下列程序的运行结果是( )。class Test extends Thread{public static void main(String[] args){Thread t=new Thread();t.start();}public void run(){System.out.println("Hello");}}A
程序不能通过编译,因为没有import语句将Thread类引入B
程序不能通过编译,因为Test类没有实现Runnable接口C
程序通过编译,且运行正常,没有任何输出D
程序通过编译,且运行正常,打印出一个"Hello"
考题
判断题一个Applet编译后的类名是Test.class,运行此小程序的命令是Java Test。A
对B
错
热门标签
最新试卷