网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
class BaseClass{ private float x= 1.0f; protected void setVar (float f) {x = f;} } class SubClass exyends BaseClass { private float x = 2.0f; //insert code here 8. } Which two are valid examples of method overriding?()
- A、 Void setVar(float f) {x = f;}
- B、 Public void setVar(int f) {x = f;}
- C、 Public void setVar(float f) {x = f;}
- D、 Public double setVar(float f) {x = f;}
- E、 Public final void setVar(float f) {x = f;}
- F、 Protected float setVar() {x=3.0f; return 3.0f; }
参考答案
更多 “ class BaseClass{ private float x= 1.0f; protected void setVar (float f) {x = f;} } class SubClass exyends BaseClass { private float x = 2.0f; //insert code here 8. } Which two are valid examples of method overriding?()A、 Void setVar(float f) {x = f;}B、 Public void setVar(int f) {x = f;}C、 Public void setVar(float f) {x = f;}D、 Public double setVar(float f) {x = f;}E、 Public final void setVar(float f) {x = f;}F、 Protected float setVar() {x=3.0f; return 3.0f; }” 相关考题
考题
使用VC6打开考生文件夹下的工程test10_1,此工程包含一个源程序文件test10_1.cpp,但该程序运行有问题,请改正程序中的错误,使程序的输出结果为;class Baseclass D1class D2class D3fin Base源程序文件test10_1.cpp清单如下:include<iostream.h>class Base{public:Base(){cout<<"class Base"<<endl;}void f(){cout<<"f in Base"<<endl;}};class D1:virtual public Base{public:D1(){cout<<"class D1"<<endl;}void f(){cout<<"f in D1"<<endl;}};/*********found**********/class D2:public Base{public:D2(){cout<<"class D2"<<endl;}/**********found**********/class D3::public D1,public D2{public:D3(){cout<<"class D3"<<endl;}};void main(){D3 d;/**********found************/d.f();}
考题
Youarecreatinganonlinecatalogapplicationthat&ens
YouarecreatinganonlinecatalogapplicationthatwilldisplayproductinformationonthecompanyWebsite.TheproductdataisstoredinaSQLServer2005database.ThedataisstoredasrelationaldatabutmustbepassedtotheapplicationasanXMLdocumentbyusingFORXML.YoutestyourapplicationandnoticethatnotalloftheitemsmatchingyourqueryappearintheXMLdocument.Onlythoseproductsthathavevaluesforallelementsintheschemaappear.YouneedtomodifyyourTransact-SQLstatementsothatallproductsmatchingyourqueryappearintheXMLdocument.Whatshouldyoudo?()
考题
分析下列程序中类MyClass的定义class BaseClass{publicinti;}classMyClass:BaseClass//继承BaseClass{publicnewinti;}则下列语句在Console上的输出为_______.()MyClassy=newMyClass();BaseClassx=y;//父类指针x指向子类对象x.i=100;//操作父类i Console.WriteLine("{0},{1}"A、0,0B、100,100C、0,100D、100,0
考题
下面程序输出的结果为 #include"iostream.h" class A { public: A(){cout<<"CLASSA"<<endl;} ~A() {} }; class B:public A { public: B(){cout<<"CLASSB"<<endl;} ~B() {} }; void main() { A * p; p=new B; B *q; q=new B; }A.CLASS A CLASS BB.CLASS A CLASS B CLASS BC.CLASS A CLASS B CLASS A CLASS BD.CLASS A CLASS B CLASS B CLASS B
考题
下面程序输出的结果为#include"iostream.h"class A{public:A( ){cout<<"CLASS A"<<endl;}~A( ){}};class B:public A{public:B( ){cout<<"CLASS B"<<endl;}~B( ){}};void main( ){A*p;p=new B;B *q;q=new B;}A.CLASS A CLASS BB.CLASS A CLASS B CLASS BC.CLASS A CLASS B CLASS A CLASS BD.CLASS A CLASS B CLASS B CLASS B
考题
12 一个给定的数值由左边开始升位到右边第 N 位,如00101 == 0100或者0001 00114 == 0011 0000请用 C 或者 C++或者其他 X86 上能运行的程序实现。----------------------------------------------------------------------------------------------------------------附加题(只有在完成以上题目后,才获准回答)In C++, what does "explicit" mean? what does "protected" mean?explicitC++ SpecificThis keyword is a declaration specifier that can only be applied toin-class constructor declarations. Constructors declared explicit will notbe considered for implicit conversions. For example:class X {public:explicit X(int); //legalexplicit X(double) { //legal // ... }};explicit X::X(int) {} //illegalAn explicit constructor cannot take part in implicit conversions. It canonly be used to explicitly construct an object. For example, with the classdeclared above:void f(X) {}void g(int I){f(i); // will cause error}void h(){X x1(1); // legal}The function call f(i) fails because there is no available implicitconversion from int to X.Note It is meaningless to apply explicit to constructors with multiplearguments, since such constructors cannot take part in implicit conversions.END C++ SpecificprotectedC++ Specific —protected: [member-list]protected base-classWhen preceding a list of class members, the protected keyword specifiesthat those members are accessible only from member functions and friends ofthe class and its derived classes. This applies to all members declared upto the next access specifier or the end of the class.When preceding the name of a base class, the protected keyword specifiesthat the public and protected members of the base class are protectedmembers of the derived class.Default access of members in a class is private. Default access of membersin a structure or union is public.Default access of a base class is private for classes and public forstructures. Unions cannot have base classes.For related information, see public, private, friend, and Table of MemberAccess Privileges.END C++ SpecificExample// Example of the protected keywordclass BaseClass {protected: int protectFunc();};class DerivedClass : public BaseClass{ public:int useProtect() { protectFunc(); } // protectFunc accessible fromderived class};void main(){BaseClass aBase;DerivedClass aDerived;aBase.protectFunc(); // Error: protectFunc not accessibleaDerived.protectFunc(); // Error: protectFunc not accessible in derivedclass } How do you code an infinite loop in C?
考题
下面程序输出的结果为 #include"iostream.h” class A { public: A(){cout<<"CLASSA"<<endl;} ~A() {} }; class B:public A { public: B(){cout<<"CLASS B"<<endl;} ~B(){} }; void main() { A*p; p=new B;A.CLASS A CLASS B CLASS B CLASS BB.CLASS A CLASS B CLASS A CLASS BC.CLASS A CLASS B CLASS BD.CLASS A CLASS B
考题
Companycomisplanningap5595runningAIX5L&ens
Companycomisplanningap5595runningAIX5L5.3LPARs.Theywouldliketodesignthesystemusingphysicalresourceswithmaximumresourceefficiency.OneLPARrequiresapeakloadof30processorsduringtheweekwithalowof1processorrequiredontheweekend.TheotherLPARrequiresonlyasingleprocessormostofthetime,butneedsatleast24processorsatthebeginningoftheweekendtofinishitsweeklyprocessinginthewindowallocated.WhichofthefollowingsolutionsismostappropriatetocontinuouslymaximizeresourceuseforthesetwoLPARs?()
考题
下面程序输出的结果为( )。 #inClUde”iostream.h” Class A {public: A(){cout<<“CLASS A”<<endl;} ~A()<)}; class B:public A {public: B(){cout<<”CLASSB”<<endl;} ~B(){}}; void main() {A*p; p=new B; B *q; q=new B;}A.CLASS A CLASS BB.CLASS A CLASS B CLASS BC.CLASS A ClASS BD.CLASS A CLASS B CLASS A CLASS B CLASS B CLASS B
考题
YouareresponsibleforCompany‘snetwork.You&ens
YouareresponsibleforCompany‘snetwork.YouhavebeenassignedthetasktocreateanddeployastandardWindows2000Professionalimageto1,000newclientcomputersintheCompany‘smainoffice.YoulogontoaclientcomputernamedDuplicateTKbyusingthelocaladministratoraccount.YouinstallthreeWindows2000ProfessionalcompatiblesoftwarepackagesonDuplicateTK.Afterthesoftwareinstallationsaredoneyoucreateanimagewithathird-partyimagingsoftware.Youdeploytheimagetoatestclientcomputerandjointheclienttoadomain.Whenyoulogontothetestcomputerbyusingadomainuseraccount,thenewapplicationsdonotappearinthestartmenu.Youneedtobeabletore-createtheimagetoincludetheapplicationsintheStartmenuforallusers.WhatactionshouldyoutakeonDuplicateTK?()
考题
YouareaExamSheetInc.consultantwhousesa&ens
YouareaExamSheetInc.consultantwhousesaWindows2000Professionalportablecomputer.YourdomainuseraccountisamemberofthelocalAdministratorgroup.Fromyourportablecomputer,youmapadrivetoasharedfoldernamedConsultMerticsonacomputernamedServer1.YouconfigureConsultMerticstobeavailableoffline.Whenyoulogoftheportablecomputer,youreceivethefollowingerrormessage.Youneedtosuccessfullysynchronizetheofflinefiles.Whatshouldyoudo?()
考题
对于下面( )类定义,可以通过“newJ_Class()”生成类J_Class的实例对象。A、publicclassJ_Class{publicJ_Class(void){}}B、publicclassJ_Class{}C、publicclassJ_Class{publicJ_Class(Strings){}}D、publicclassJ_Class{publicvoidJ_Class(){}publicJ_Class(Strings){}
考题
Alloftheclientcomputersinyourcompany’s&ens
Alloftheclientcomputersinyourcompany’snetworkareWindows2000portablecomputers.AusernamedMariastoresSalesfilesinherMyDocumentsfolder.Sheusesthesefileswhenshetravels.Mariainformsyouthatwhenshetakesherportablecomputertotradeshows,shecanaccesssomeoftheSalesfilesbutnotallofthem.Whenherportablecomputerisconnectedtothenetworkattheoffice,shecanaccessallofthefiles.YouneedtoenableMariatoaccessallofthefilesinherMyDocumentsfolderwhensheisworkingremotely.Whatshouldyoudo?()
考题
YouareaWindowsServer2008systemsadministrator&ens
YouareaWindowsServer2008systemsadministratorresponsibleforprovidingaccesstoalargevolumeofvideofilestoregisteredusersofyourorganization??spublicWebsite.Allthevideofilesarelocated withintheD:\Public\Videosfolder.Contentproducersoftencreateandmodifythesevideos.Recently,usershavecomplainedthattheyareexperiencingpoorperformancewhenaccessingvideosduringbusytimes.Duringtheseimages,theWindowsMediaServicesserverthathoststhecontentisexperiencinghighCPUandnetworkbandwidthuse.Youwanttominimizetheadministrativetimeandeffortrequiredtoincreaseperformance.Whichofthefollowingactionsshouldyoutaketoresolvetheproblem?()
考题
In which two cases does the compiler supply a default constructor for class A?() A、 class A{}B、 class A { public A(){} }C、 class A { public A(int x){} }D、 class Z {} class A extends Z { void A(){} }
考题
从CommandButton基类创建子类cmdA和cmdB,再由cmdA类创建cmdAA子类,则cmdA、cmdB和cmdAA必具有相同的()A、Caption属性B、Name属性C、BaseClass属性D、ParentClass
考题
Which of the following class addresses is reserved for multicast?()A、 Class AB、 Class BC、 Class CD、 Class D
考题
Which of the following class networks contains 65,534 hosts?()A、Class AB、Class BC、Class CD、Class D
考题
What produces a compiler error?() A、 class A { public A(int x) {} }B、 class A {} class B extends A { B() {} }C、 class A { A() {} } class B { public B() {} }D、 class Z { public Z(int) {} } class A extends Z {}
考题
多选题class BaseClass{ private float x= 1.0f; protected void setVar (float f) {x = f;} } class SubClass extends BaseClass { private float x = 2.0f; //insert code here } Which two are valid examples of method overriding?()AVoid setVar(float f) {x = f;}BPublic void setVar(int f) {x = f;}CPublic void setVar(float f) {x = f;}DPublic double setVar(float f) {x = f;}EPublic final void setVar(float f) {x = f;}FProtected float setVar() {x=3.0f; return 3.0f; }
考题
多选题1. class BaseClass { 2. private float x = 1.of; 3. protected float getVar() { return x; } 4. } 5. class SubClass extends BaseClass { 6. private float x = 2.Of; 7. // insert code here 8. } Which two are valid examples of method overriding when inserted at line 7?()Afloat getVar() { return x; }Bpublic float getVar() { return x; }Cpublic double getVar() { return x; }Dprotected float getVar() { return x; }Epublic float getVar(float f) { return f; }
考题
多选题class BaseClass{ private float x= 1.0f; protected void setVar (float f) {x = f;} } class SubClass exyends BaseClass { private float x = 2.0f; //insert code here 8. } Which two are valid examples of method overriding?()AVoid setVar(float f) {x = f;}BPublic void setVar(int f) {x = f;}CPublic void setVar(float f) {x = f;}DPublic double setVar(float f) {x = f;}EPublic final void setVar(float f) {x = f;}FProtected float setVar() {x=3.0f; return 3.0f; }
考题
单选题What produces a compiler error?()A
class A { public A(int x) {} }B
class A {} class B extends A { B() {} }C
class A { A() {} } class B { public B() {} }D
class Z { public Z(int) {} } class A extends Z {}
热门标签
最新试卷