[单选题]

在下列程序的划线处应填入的语句是class Person { private int a;}public class Man extends Person{ public int b; public static void main (String arg []){ Person p=new Person(); Man t=new Man(); int i: }}

A.i=w;

B.i=b

C.i=p.a;

D.i=t.b;

参考答案与解析:

相关试题

在下列程序的划线处应填入的语句是()。 class Person { priva

[单选题]在下列程序的划线处应填入的语句是( )。 class Person { private int a: } public class Man extends Person{ public int b; public static void main(String arg []){ Person p=newPerson(); Man t=new Man(); int i; _________________ } }A.i=w;B.i=b;C.i=P.a;D.i=t.b;

  • 查看答案
  • 在下列程序的划线处应填入的语句是 class Pemon { pnvate in

    [单选题]在下列程序的划线处应填入的语句是 class Pemon { pnvate int a; } public class Man extends Person { public int b; public static void main(String arg[ ] ) { Person p = new Person( ); Man t = new Man( ); int i; ________ } }A.i = w;B.i = b;C.i = p.a;D.i = t.b;

  • 查看答案
  • 下列程序中横线处应填入的语句是()。Class Base{public:roid

    [单选题]下列程序中横线处应填入的语句是( )。 Class Base { public: roid fun(){cout<<“Base of fun”<<endl;) }; class Derived:public Base { void fun() { //显示基类的成员函数fun cout<<“Derived Of fun”<<endl; } };A.fun();B.Base.fun();C.Base::fun();D.Base->fun();

  • 查看答案
  • 下列程序中下画线处应填入的语句是 class Base { public: vo

    [单选题]下列程序中下画线处应填入的语句是class Base{public:void fun( ) {cout < < "Baseoffun" < < endl;}};class Derived:public Base{void fun( ){______//显示基类的成员函数funcout < < "Derived of fun" < < endl;}};A.fun( ) ;B.Base. fun( ) ;C.Base: :fun( ) ;D.Base->fun( ) ;

  • 查看答案
  • 下列程序中画线处应填入的语句是class Base{public:void fu

    [单选题]下列程序中画线处应填入的语句是 class Base { public: void fun( ){cout<<"Base of fun"<<end1;} }; class Derived:public Base { void fun( ) { ______//显示基类的成员函数fun cout<A.fun( );B.Base.fun( );C.Base: :fun( );D.Base->fun( );

  • 查看答案
  • 下列程序中画线处应填入的语句是class Base{ public:void f

    [单选题]下列程序中画线处应填入的语句是 class Base { public: void fun(){cout<<"Base of fun"<<end1:} }; class Derived:public Base { void fun() { _______//显示基类的成员函数fun cout<<"Derived of fun"<<end1; } };A.fun();B.Base.fun();C.Base∷fun();D.Base- >fun();

  • 查看答案
  • 能将程序补充完整的选项是______。class Person{private

    [单选题]能将程序补充完整的选项是______。 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=

  • 查看答案
  • 请在下划线处填入代码,是程序正常运行并且输出 “ Hello! ”Class T

    [试题]请在下划线处填入代码,是程序正常运行并且输出 “ Hello! ”C.lass Test ( 15 ) {Public static void main (String[] arge){Test t = new Test();t.start();}Public void run(){System.out.println( “ Hello! ” );}

  • 查看答案
  • ( 11 )在下列程序的下划线处,填入适当语句使程序能正确执行并输出异常栈信息。

    [试题]( 11 )在下列程序的下划线处,填入适当语句使程序能正确执行并输出异常栈信息。public class ThrowableException{public static void main(String args[]){try{throw new Throwable(" 这里是本人定义的异常 ");}catch(Throwable e){System.out.println("Caught Throwable");System.out.println("e.getMessage():

  • 查看答案
  • 能将程序补充完整的选项是()。class Person{private int

    [单选题]能将程序补充完整的选项是( )。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; ______ }} B.A.i=m

  • 查看答案
  • 在下列程序的划线处应填入的语句是class Person {private in