itgle.com

classParent{Stringone,two;classParent{Stringone,two;publicParent(Stringa,Stringb){one=a;two=b;}publicvoidprint(){System.out.println(one);}}publicclassChildextendsParent{publicChild(Stringa,Stringb){super(a,b);}publicvoidprint(){System.out.println(one+"to"

题目
classParent{Stringone,two;

classParent{

Stringone,two;

publicParent(Stringa,Stringb){

one=a;

two=b;}

publicvoidprint(){System.out.println(one);}}

publicclassChildextendsParent{

publicChild(Stringa,Stringb){

super(a,b);

}

publicvoidprint(){

System.out.println(one+"to"+two);

}

publicstaticvoidmain(Stringarg[]){

Parentp=newParent("south","north");

Parentt=newChild("east","west");

p.print();

t.print();

}

}

Whichofthefollowingiscorrect?()


相似考题
更多“classParent{Stringone,two;<br ”相关问题
  • 第1题:

    有如下程序: include using namespace std; class PARENT { public: PARENT() { cout

    有如下程序:

    include <iostream>

    using namespace std;

    class PARENT

    {

    public:

    PARENT() { cout <<"PARENT"; }

    };

    class SON : public PARENT

    {

    public:

    SON() {cout << "SON"; }

    };

    int main()

    {

    SON son;

    PARENT *p;

    p = &son;

    return 0;

    }

    执行上面程序的输出是______。


    正确答案:PARENTSON
    PARENTSON 解析:此题考查的是派生类的构造。主函数开始在定义SON类的对象son时,会先执行PARENT类的构造函数再执行SON类的构造函数,输出 “PAKENTSON”;接下来的语句定义PARENT和让指针p指向son对象,都并未创建任何对象,所以不会调用构造函数。故最终的输出结果是:PARENTSON。

  • 第2题:

    The ONS 15216 is a 32-channel system. The ONS 15216 OADMs are capable of adding and dropping one, two, or four channels. How are the OADMs provisioned to add and drop specific channels?()

    A. The ONS 15216 OADM can be provisioned to add/drop one, two, or four channels via Cisco Transport Manager (CTM).

    B. The ONS 15216 OADM consists only of a four-channel module, and the number of ports utilized determines whether it is a one, two, or four channel OADM.

    C. Three separate OADM modules are available for one, two, and four channels. The wavelengths to be dropped and added are programmable via Cisco Transport Manager (CTM).

    D. The ONS 15216 OADM consists only of a single-channel module. Two-channel and four-channel support is available by stacking the single-channel module.

    E. The ONS 15216 OADM is available in one, two, four channels. There are 32 single-channel OADM modules, 16 two-channel OADM modules, and 8 four-channel OADM modules.


    参考答案:E

  • 第3题:

    12. About_______ of the workers in the factory were born in the __________.

    A. two- thirds;1970

    B. two- thirds ; 1970s

    C. two-third ; 1970

    D. two-third ; 1970s


    正确答案:B
    12.B【解析】句意:工厂里大约2/3的工人出生在20世纪70年代。分数的表达为分子用基数词,分母用序数词,如果分子大于1,则分母要用复数,排除C、D,年代的表达要在年份后加s.故选B。

  • 第4题:

    TheONS15216isa32-channelsystem.TheONS15216OADMsarecapableofaddinganddroppingone,two,orfourchannels.HowaretheOADMsprovisionedtoaddanddropspecificchannels?()

    A.TheONS15216OADMcanbeprovisionedtoadd/dropone,two,orfourchannelsviaCiscoTransportManager(CTM).

    B.TheONS15216OADMconsistsonlyofafour-channelmodule,andthenumberofportsutilizeddetermineswhetheritisaone,two,orfourchannelOADM.

    C.ThreeseparateOADMmodulesareavailableforone,two,andfourchannels.ThewavelengthstobedroppedandaddedareprogrammableviaCiscoTransportManager(CTM).

    D.TheONS15216OADMconsistsonlyofasingle-channelmodule.Two-channelandfour-channelsupportisavailablebystackingthesingle-channelmodule.

    E.TheONS15216OADMisavailableinone,two,fourchannels.Thereare32single-channelOADMmodules,16two-channelOADMmodules,and8four-channelOADMmodules.


    参考答案:E

  • 第5题:

    About ________ of the workers in the factory were born in the ________.

    A.two-thirds, 1970 B.two-thirds, 1970s C.two-third,1970 D.two-third, 1970s


    正确答案:B