单项选择题
能将程序补充完整的选项是 class Person { private int a; public int change(int m){return m;} } public class Teacher extends Person { public int b; public static void main(String arg[]) { Person p=new Person(); Teacher t=new Teacher(); int i; ____ } }
A.i=m
B.i=b
C.i=a
D.i=change(50)
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
填空题
在面向对象方法中,属性与操作相似的一组对象称为 【2】 。
点击查看答案&解析
单项选择题
下面程序段的输出结果是 classTest{ public static void main(Stringargs[]){ MyThread t=new MyThread(); t.displayOutput(”t has been createD) ”); t.start(); } } Class MyThread extends Thread{ public void displayOutput(Strings){ System.out.println(S); } public void run(){ displayOutput(”t is running.”); } }
A.thas been create t is runnin
B.thas been created
C.t is runnin
D.编译出错
点击查看答案&解析
相关试题
一个类只有实现了 【14】 接口,它的对...
下面程序段是从对象流中读取对象,请将程序...
请将程序补充完整。import java.awt.*...
使得线程放弃当前分得的CPU时间,但不使线...
sum的值为0,则result=sum==01:num...