单项选择题

能将程序补充完整的选项是______。 class Person{ private int a; phblic 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)
<上一题 目录 下一题>
热门 试题

单项选择题
下面程序段的输出结果是______。 class Test{ public static void main(String args[ ]){ MyThread t=new MyThread( ); t.displayOutput( t has been created ); t.start( ); } } class MyThread extends Thread{ public void display Output(String s){ System.out,println(s); } public void run( ){ displayOutput( t is running ); } }
A.t has been created t is running
B.t has been created
C.t is running
D.编译错误
单项选择题
执行下列程序之后,变量n的值为______。 public class Test{ public static void main(String[ ]args){ int y=2; int z=3; int n=4; n=n+-y*z n; System.out.println(n); } }
A.3
B.-1
C.-12
D.-3
相关试题
  • 下列程序的功能是创建一个显示5个“Hello...
  • 如果有一个类MyFrame是Frame类的子类,但它...
  • 一个类只有实现了______接口,其对象...
  • int型public成员变量MAX_LENGTH的值保持为...
  • 所有由Container派生的类称为______...