• 2022-07-22 问题

    下列选项中,关于接口的定义正确的是? A: abstractclassDemo1{abstractvoidspeak();abstractvoideat();} B: interfaceDemo2{voidspeak();voideat();} C: interfaceDemo3{voidspeak();voideat(){};} D: interfaceDemo4{voidspeak(){System.out.println("ITCAST");}voideat();}

    下列选项中,关于接口的定义正确的是? A: abstractclassDemo1{abstractvoidspeak();abstractvoideat();} B: interfaceDemo2{voidspeak();voideat();} C: interfaceDemo3{voidspeak();voideat(){};} D: interfaceDemo4{voidspeak(){System.out.println("ITCAST");}voideat();}

  • 2021-04-14 问题

    阅读下列程序,程序的运行结果是____。 #include usingnamespacestd; classAnimal { public: voidspeak(){cout<<"animallanguage!"<<endl;} }; classCat:publicAnimal { public: voidspeak(){cout<<"catlanguage:miaomiao!"<<endl;} }; intmain() { Catcat; cat.speak(); }

    阅读下列程序,程序的运行结果是____。 #include usingnamespacestd; classAnimal { public: voidspeak(){cout<<"animallanguage!"<<endl;} }; classCat:publicAnimal { public: voidspeak(){cout<<"catlanguage:miaomiao!"<<endl;} }; intmain() { Catcat; cat.speak(); }

  • 1