下面程序执行后的输出结果为( )。 public class fun { public static void main(String args[]) { String greets = " How are you!"; String s = greets.substring(0,3); System.out.println(s); } }A.HowB.areC.youD.how are you!

下面程序执行后的输出结果为( )。 public class fun { public static void main(String args[]) { String greets = " How are you!"; String s = greets.substring(0,3); System.out.println(s); } }

A.How

B.are

C.you

D.how are you!


相关考题:

在下面程序的横线处填上适当的语句,使程序执行后的输出结果为ABCD。 include using nam 在下面程序的横线处填上适当的语句,使程序执行后的输出结果为ABCD。include<iostream>using namespace std;classA{public:A(){cout<<'A';}};class B:______{public:B(){cout<<'B';}};class C:______{public:C(){cout<<'C';}};class D:public B,public C{public:D(){cout<<'D';}};void main(){D obj;)

下面程序的输出结果为:Base:: fun,请将程序补充完整。include class Base{public: 【】 下面程序的输出结果为:Base:: fun,请将程序补充完整。include <iostream.h>class Base{public:【 】 fun(){cout<<"Base::fun"<<end1:}class Derived : public Base{public:【 】 fun(){ cout<<"Derived::fun"<<end1; }};int main(){Base a,*pb;Derived b;pb = b;pb->fun();return 0;}

在下面程序的画线处填上适当的内容,使程序执行后的输出结果为ABCD。 include using 在下面程序的画线处填上适当的内容,使程序执行后的输出结果为ABCD。include <iostream>using namespace std;class A{public:A( ){cout<<'A';}};class B: (11) {public:B( ){cout<<'B';}{;class C: (12) {public:C( ){cout<<'C';}};class D:public B,public C{public:D( ){cout<<'D';}};void main( ){D( );cout<<endl;}

有如下程序:include using namespace std;class Base{ public: void fun() { cout 有如下程序: #include <iostream> using namespace std; class Base { public: void fun() { cout<<"Base::fun"<<endl; } }; class Derived : public Base { public: void fun() { ______ cout<<"Derived::fun"<<endl; } }; int main() { Derived d; d.fun(); return 0; } 已知其执行后的输出结果为: Base::fun Derived::fun 则程序中下划线处应填入的语句是( )。A.Base.fun();B.Base::fun();C.Base->fun();D.fun();

对于下面程序,对p进行赋值正确的是( )。 class A{ public:fun(int i){cout<<i<<endl;} }; main(){ void(A::*p)(int); }A.p=fun;B.p=fun();C.p=A::fun;D.p=A::fun()

在下面程序的横线处填上适当的内容,使程序执行后的输出结果为ABCD。 include usingn 在下面程序的横线处填上适当的内容,使程序执行后的输出结果为ABCD。include <iostream.h>using namespace std;class A{public: A() {cout<<'A';};class B:______{public: B() {cout<<'B';}};class C:______{public: C(} cout<<'C';}};class D:public B, public C{public: D(){cout<<'D';}};void main(){D obj;}

有如下程序: include using namespace std; class Base { public: 有如下程序: #include<iostream> using namespace std; class Base { public: void fun() { cout<<"Base::fun"<<endl; } }; class Derived: public Base { public: void tim() } ____________ cout<<"Derived:: fun"<<endl; } }; int main() { Derived d; d.fun(); return O; } 已知其执行后的输出结果为: Base::fun Derived::fun 则程序中下划线处应填入的语句是A.Base.fun();B.Base::fun();C.Base->fun();D.fun();

下面程序的结果是 ______。includeclass A{ public:virtual voidfun()=0{};};class 下面程序的结果是 ______。 #include<iostream.h> class A{ public: virtual void fun()=0{}; }; class B:public A{ public: void fun () {cout<< "new file" ;} }; class C: public A{ public: void fun (){cout<<"open file"<< " " } }; class D: public A{ public: void fun () {cout<< "save file\n" ;} }; void main() { A a,*p; B b; C c; D d; p=c; p->fun (); p=b; p->fun (); p=d; p->fun(); }A.new file open file save fileB.new file new file new fileC.编译出错D.open file new file save file

在下面程序的横线处填上适当的内容,使程序执行后的输出结果为ABCD。 include using nam 在下面程序的横线处填上适当的内容,使程序执行后的输出结果为ABCD。include<iostream>using namespace std;class A{public: A(){cout<<'A';}};class B:【 】{public:B(){cout<<'B';)};class C:【 】{public;C(){cout<<'C';}};class D:public B,public C{public:D(){cout<<'D';}};void main(){D obi;}

阅读以下说明和Java程序,填写程序中的空(1)~(6),将解答写入答题纸的对应栏内。【说明】以下Java代码实现一个简单绘图工具,绘制不同形状以及不同颜色的图形。部分接口、类及其关系如图5-1所示。【Java代码】interface?DrawCircle?{? //绘制圆形 public(1) ;}class?RedCircle?implements?DrawCircle?{? ?//绘制红色圆形???????public?void?drawCircle(int?radius,intx,?int?y)??{????????????System.out.println("Drawing?Circle[red,radius:"?+?radius?+",x:"?+?x?+?",y:"?+y+?"]");???????}}class?GreenCircle?implements?DrawCircle?{????//绘制绿色圆形??????public?void?drawCircle(int?radius,?int?x,int?y)?{???????????System.out.println("Drawing?Circle[green,radius:"?+radius+",x:?"?+x+?",y:?"?+y+?"]");??????}}abstract?class?Shape?{????//形状? protected? ? (2)???;? ? public?Shape(DrawCircle?drawCircle)?{? ?this.drawCircle=?drawCircle;? ? ? public?abstract?void?draw();}class?Circle?extends?Shape?{? //圆形? ?private?int?x,y,radius;? public?Circle(int?x,int?y,intradius,DrawCircle?drawCircle)?{? ?(3)???;? this.x?=?x;? ? ? this.y?=?y;? ?this.radius?=radius;? }? ? ?public?void?draw()?{? ? drawCircle.? ?(4)? ?;? ? ? }}public?class?DrawCircleMain?{? public?static?void?main(String[]?args)?{? Shape?redCircle=new?Circle(?100,100,10,? (5) );//绘制红色圆形? Shape?greenCircle=new?Circle(200,200,10,(6) );//绘制绿色圆形? ?redCircle.draw(); greenCircle.draw();? ?}}