WordPress.com
Id1QuestionPolymorphism is supported by the c++ by using following waysAfunction overloadingBoperator overloadingCvirtual functionsDall of the aboveAnswerDMarks1UnitIIId2QuestionCompile time polymorphism is supported byAfunction overloadingBvirtual functionCoperator overloadingDboth a&cAnswerDMarks1UnitIIId3QuestionRun time polymorphism is supported byAfunction overloadingBoperator overloadingCvirtual functionDboth a and bAnswerCMarks1UnitIIId4QuestionSelecting the appropriate overloaded function by the compiler is known asAlate bindingBearly bindingCboth a and bDnone of the aboveAnswerBMarks1UnitIIId5Questionobject to function binding is done at compile time then is it known asAearly bindingBcompile time bindingCnone of the aboveDboth a and bAnswerDMarks1UnitIIId6QuestionRun time polymorphism is done by usingAfunction overloadingBoperator overloadingCvirtual functionDnone of the aboveAnswerCMarks1UnitIIId7QuestionOperator overloading is ---.Arun time polymorphismBcompile time polymorphismCnone of the aboveDboth a and bAnswerBMarks1UnitIIId8QuestionWhich of the following operator cannot be overloadedAscope resolution operator(::)BSize of operator (sizeof[])CConditional operator(?:)DAll of the aboveAnswerDMarks1UnitIIId9QuestionWhich of the operator cannot be overloadedA>=B&C<=D::AnswerDMarks1UnitIIId10QuestionWhile performing operator overloading which function/keyword we have to useAFunctionBOperatorCOpDnone of the aboveAnswerBMarks1UnitIIId11QuestionWhich of the statement is not true about operator overloadingAwe can overload only existing operatorBbasic meaning cannot be changedCbinary operator should have return typeDAll of the aboveAnswerDMarks1UnitIIId12QuestionPick up the correct statement related with operator overloadingAwe can overload a class access operatorBwe can change the meaning of basic operatorCbinary operator should have a return typeDboth a and bAnswerCMarks1UnitIIId13QuestionWe are overloading a unary operator without friend function how many argument we have to passA1B2C0Dnone of the aboveAnswerCMarks1UnitIIId14QuestionSuppose we are overloading a binary operator with friend function, how many parameter of argument we have to passA1B2C3Dnone of ths aboveAnswerBMarks1UnitIIId15Questionwe are overloading a binary operator without friend function how many argument we have to passA1B2C0Dnone of the abveAnswerAMarks1UnitIIId16QuestionWhat is polymorphismAit is ability to take many formsBit is instance of classCone class acquire the properties of another classDAll of the aboveAnswerAMarks1UnitIIId17QuestionWhat is true about the operator overloadingAwith friend function we need to pass two arguments for binary operatorBwith friend function we need to pass one arguments for unary operatorCboth a and bDnone of the aboveAnswerCMarks1UnitIIId18Question______allows you to give special meaning to some operator when there are operands associated with it.Afunction overloadingBvirtual functionCoperator overloadingDnone of the aboveAnswerCMarks1UnitIIId19QuestionConverting from small to larger data type is known as ____.ApromotionBoperatorCpolymorphismDnone of the aboveAnswerAMarks1UnitIIId20Questionwhat are the types of type conversionAimplicitBexplicitCboth a and bDnone of the aboveAnswerCMarks1UnitIIId21QuestionReusability is supported by following featureApolymorphismsBmessage passingCinheritanceDoperator overloadingAnswerCMarks1UnitIIId22QuestionDeriving a new class from a base class is known as __.ApolymorphismsBinheritanceCmessage passingDoperator overloadingAnswerBMarks1UnitIIId23QuestionBase class is also known as___.Asuper classBparent classCboth a and bDnone of the aboveAnswerCMarks1UnitIIId24QuestionChild class is also known asAsub classBderived classCboth a and bDknown classAnswerCMarks1UnitIIId25QuestionDerived class___ cannot access from base classAconstructorBdestructorsCcopy constructorDall of the aboveAnswerDMarks1UnitIIId26Questionwe can derive a new class from a derived classAtrueBfalseCDAnswerAMarks1UnitIIId27QuestionHow many parameter does a conversion operator take?A0B2C3Das many as possibleAnswerAMarks1UnitIIId28Question__is used to define pure virtual function?A&B=0C@D*AnswerBMarks1UnitIIId29QuestionWhich is also known as abstract class?Avirtual functionBpure virtual functionCderived class functionDbase class functionAnswerBMarks1UnitIIId30Questionpick the correct optionAWe can make the instance of the abstract classBWe can not make the instance of the abstract classCboth a and bDnone of the aboveAnswerBMarks1UnitIIId31QuestionHow many access specifiers are there in c++?A2B3C5D4AnswerBMarks1UnitIIId32QuestionWhere we have to use an abstract class?Ain base class onlyBin derived class onlyCboth and bDNone of the aboveAnswerAMarks1UnitIIId33QuestionFor what we can apply accessAfunctionBdata memberCnone of the above specifierDboth a and cAnswerDMarks1UnitIIId34QuestionWhat is default access specifier for class?ApublicBprotectedCprivateDnone of the aboveAnswerCMarks1UnitIIId35QuestionWe have to define a constructor for the derived class must be required____.Aif base class constructor does not require argumentsBif base/parent class constructor required argumentsCno needDalwaysAnswerBMarks1UnitIIId36QuestionUse of the friend function is___.Athe class allowing access to another classBthe private section of a classCthe public section of the classDall of the aboveAnswerDMarks1UnitIIId37QuestionIf an attribute is private define then which method can have access to itAonly static functionBonly functions of that classConly method in that packageDnone of the aboveAnswerBMarks1UnitIIId38QuestionWhat is syntax of deriving a new class from base class is___.Aclass name, new class nameBnew class name, base class nameCclass name: access specifier class nameDnone of the aboveAnswerCMarks1UnitIIId39QuestionWhich constructor will initialize the base class data memberAbase classBderived classCderived derived classDnone of theseAnswerAMarks1UnitIIId40QuestionInheritance can be done using :: symbolATrueBFalseCDAnswerBMarks1UnitIIId41QuestionWhen we derived a new class using more than one class then type of inheritance is known as____.Amultiple inheritanceBsingle inheritanceChybrid inheritanceDmultilevel inheritanceAnswerAMarks1UnitIIId42QuestionWhen class B is derive from A , and class C is derived from B, this kind of inheritance is known as ______.Amultiple inheritanceBsingle inheritanceChybrid inheritanceDmultilevel inheritanceAnswerDMarks1UnitIIId43QuestionThe base class will provide you__________.Aspecific objects than the derived classBmore generalized version of derived classCempty template of base classDall of the aboveAnswerBMarks1UnitIIId44QuestionPick up the correct statement form followingi)we have to use abstract keyword to define the abstract classii)inheritance allows multilevel class hierarchies more than two levels alsoiii)reusability is supported by derivationiv) we can change the meaning of operator during operator overloadingAi onlyBii onlyCi and ii onlyDii and iii onlyAnswerDMarks2UnitIIId45QuestionWhat does derived class does not inherit from the base classi)constructorii)destructoriii)operator=()iv)friendsAi and iiBii and iiiConly i, iii and ivDall of the aboveAnswerDMarks1UnitIIId46QuestionChoose the correct the statement from followingi)inheritance supported in terms of single, multiple , multilevel ,hybrid inheritanceii) polymorphisms is supported by function overloading , operator overloading and virtual functioniii) abstraction is not supported by c++Ai is correctBonly ii is correctCi and ii is correctDnone of the aboveAnswerCMarks1UnitIIId47Question_____types of classes in c++.A1B2C3D4AnswerCMarks1UnitIIId48Question:_______is used to define a pure virtual function.A$B^C=0D#AnswerCMarks1UnitIIId49QuestionPick up the correct statementAa base class may have more than one classBderived class can be derived from more than one classCboth a and bDnone of the aboveAnswerCMarks1UnitIIId50Questionclass A: public B, public C is a type of inheritanceASingleBMultipleCMultilevelDHybridAnswerBMarks1UnitIIId51QuestionWhen we have to use the mutable keywordAdata member to change within a const member functionBnot allow the data member to change within a const member functionCit will copy the values of the variableDnone of the above mentionedAnswerAMarks1UnitIIId52Questionchoose the correct statementAdestructor cannot be inheritedBprivate member not inherited to derived classCconstructor cannot inheritedDa and cAnswerDMarks1UnitIIId53QuestionUse of function or operator to act different ways on different data type is called asAderivationBinheritanceCpolymorphismsDnone of the aboveAnswerCMarks1UnitIIId54QuestionChoose the correct statementAConstructor has a return typeBconstructor always define in public scopeCconstructor has same name that of class nameDb and cAnswerDMarks1UnitIIId55Questionoverloading of a prefix increment operator by means of a member function takes_________.Aone argumentBtwo argumentCno argumentDnone of the aboveAnswerCMarks1UnitIIId56QuestionPick up the correct statementi)abstract type of class should contain at least one virtual functionii)we can create an object of abstract classiii)abstract class is used to provide an interface to subclassesiv)abstract class can also have normal functionAi and ii onlyBi , ii, and iii onlyCi ,iii and ivDall of the aboveAnswerDMarks1UnitIIId57QuestionWhat is function overloadingAwe have to use same function name but different parameterBdifferent function name but same parameterCboth a and bDnone of the aboveAnswerAMarks1UnitIIId58QuestionVirtual base class is used to ____.Ato perform operator overloadingBto perform function overloadingCto remove ambiguity in multiple inheritanceDall of the aboveAnswerCMarks1UnitIIId59QuestionPick up the correct statementAprotected member from base class can be accessed by own class and its all subclassesBprotected member are not inherited by any other classCProtected member are combination of public and private access memberDall of the aboveAnswerDMarks1UnitIIId60Questionpick up the correct statementAbase class and derived class can have their own constructorBbase class and derived class can have their own destructorCneither a or neither bDboth a and bAnswerDMarks1UnitIIId61QuestionMake a correct sequence of a statementi)destructor of derived class is calledii)destructor of base class is callediii)constructor of derived class is callediv)constructor of base class is calledAi,ii,iv,iiiBiv,iii,ii,iCiv,iii,i,iiDi,ii,iii,ivAnswerCMarks1UnitIIId62QuestionOperator overloading isAmaking C++ operators work with objects.Bgiving C++ operators more than they can handle.Cgiving new meanings to existing C++ operators.DBoth A and CAnswerDMarks2UnitIIId63QuestionAssume a class C with objects obj1, obj2, and obj3. For the statement obj3 = obj1 - obj2 to work correctly, the overloaded - operator mustAtake two arguments.Breturn a value.Cuse the object of which it is a member as an operand.DBoth B and CAnswerDMarksIIUnit2Id64QuestionWhen you overload an arithmetic assignment operator, the resultAgoes in the object to the right of the operator.Bgoes in the object to the left of the operator.Cgoes in the object of which the operator is a member.DBoth B and CAnswerDMarks2UnitIIId65QuestionTo convert from a user-defined class to a basic type, you would most likely useAa built-in conversion operator.Ba one-argument constructor.Can overloaded = operator.Da conversion operator that’s a member of the class.AnswerDMarks1UnitIIId66QuestionAn overloaded operator always requires one less argument than its numberof operands.ATRUEBFALSECDAnswerAMarks1UnitIIId67QuestionThe compiler won’t object if you overload the * operator to perform division.ATRUEBFALSECDAnswerAMarks1UnitIIId68QuestionInheritance is a way toAmake general classes into more specific classes.Bpass arguments to objects of classes.Cadd features to existing classes without rewriting them.DA and CAnswerDMarks1UnitIIId69QuestionAdvantages of inheritance includeAproviding a useful conceptual framework.Bfacilitating class libraries.Cavoiding the rewriting of code.DAll of the aboveAnswerDMarks2UnitIIId70QuestionAdding a derived class to a base class requires fundamental changes to the base class.ATRUEBFALSECDAnswerDMarks1UnitIIId71QuestionTo be accessed from a member function of the derived class, data or functions in the base class must beApublicBprivateCprotectedDstaticAnswerCMarks1UnitIIId72QuestionIf a base class contains a member function basefunc(), and a derived class does not contain a function with this name, can an object of the derived class access basefunc()?AYESBNOCDAnswerAMarks1UnitIIId73QuestionIf no constructors are specified for a derived class, objects of the derived class will use the constructors in the base class.ATRUEBFALSECDAnswerAMarks1UnitIIId74QuestionThe scope-resolution operator usuallyAspecifies a particular class.Btells what base class a class is derived from.Cresolves ambiguities.DA and CAnswerDMarks1UnitIIId75QuestionAssume a class Derv that is privately derived from class Base. An object of class Derv located in main() can accessApublic members of Derv.Bprotected members of Derv.Cprivate members of Derv.Dpublic members of Base.AnswerAMarks1UnitIIId76QuestionTrue or False: A class Dcan be derived from a class C, which is derived from a class B, which is derived from a class A.ATRUEBFALSECDAnswerAMarks1UnitIIId77QuestionIt is illegal to make objects of one class members of another class.ATRUEBFALSECDAnswerBMarks1UnitIIId78QuestionA class hierarchyAshows the same relationships as an organization chart.Bdescribes “has a” relationships.Cdescribes “is a kind of” relationships.Dshows the same relationships as a family tree.AnswerCMarks1UnitIIId79QuestionWhat is the output of the program?#include <iostream>#include <string>using namespace std;class Department {public:string dept;Department(string d):dept(d) { }void getDeptName() { cout <<dept; }};class Student : private Department {public:string name;Student(string n = "Not entered", string d = "ATDC") :name(n), Department(d) { }using Department::getDeptName;};int main() {Student s("CSE");s.getDeptName();return 0;}ACSEBATDCCNot enteredDCompilation ErrorAnswerBMarks2UnitIIId80QuestionIdentify the lines on which the compiler will report an error.#include <iostream>// ---1using namespace std; // ---2class Base { // ---3int var_; // ---4public: // ---5Base():var_(0){} // ---6}; // ---7class Derived: public Base { public: // ---8int varD_; // ---9void print () { cout <<var_; } // ---10}; // ---11int main() { // ---12Derived d; // ---13d.var_ = 1; // ---14d.varD_ = 1; // ---15cout <<d.var_ <<""<<d.varD_; // ---16return 0; // ---17} // ---18A6, 10, 14, 15B6, 15C6, 14, 16D10, 14, 16AnswerDMarks1UnitIIId81Question#include <iostream>using namespace std;class Base { public:int var_;void func(int){}};class Derived: public Base { public:int varD_;void func(int){}};int main() {Derived d;d.func(1);return 0;}Which of the following function will be invoked by d.func(1)?ABase::func(int)BDerived::func(int)CCompilation ErrorDNone of the aboveAnswerBMarks2UnitIIId82QuestionWhat is the output of the following program?#include<iostream>#include<string>using namespace std;class Base {public:void func_f1(int i) { cout <<"In base func_f1 "; }void func_f2(int i) { cout <<"In base func_f2 "; }};class Derived: public Base {public:void func_f1(int i ) { cout <<"In derived func_f1 "; }void func_f1(string s) { cout <<"func_f1 string "; }void func_f3(int i) { cout <<"In derived func_f3 "; }};int main() {Base b;Derived d;d.func_f1(3);d.func_f1("Blue");d.func_f3(3);d.func_f2(3);return 0;}ACompilation Error: Cannot add new parameters to func_f1BIn derived func_f1 func_f1 string In derived func_f3 In base func_f2CIn base func_f2 func_f1 string In derived func_f3 In derived func_f1DCompilation Error: Cannot define func_f3 containing same parameter type as func_f1AnswerBMarks2UnitIIId83QuestionWhat is the output of the following program? {Assume size of int as 4}#include<iostream>using namespace std;class base {int data;};class derived1: public base { };class derived2: public derived1 { };int main() {cout <<sizeof(derived2);return 0;}A4B8C12D16AnswerAMarks1UnitIIId84QuestionWhat will be the output of the following program?#include <iostream>using namespace std;class B{ public: int base;B() {}~B() {}};class D: public B { public: int derived;D() {}~D() {}};int main() {D d1;B b1;cout <<&b1.base <<"";cout <<&d1.base;return 0;}A0x28fef8 0x28fef8B0x28fef8 0x28fefcCCompilation ErrorDNone of the aboveAnswerBMarks2UnitIIId85QuestionWhat will be the output of the following program?#include<iostream>using namespace std;class Base { public:Base() { cout <<"Base Ctor"<<endl; }~Base() { cout <<"Base Dtor"<<endl; }};class Derived: public Base { public:Derived() { cout <<"Derived Ctor"<<endl; }~Derived() { cout <<"Derived Dtor"<<endl; }};int main() {Derived d1;{Base b1;}return 0;}ABase CtorDerived CtorBase CtorBase DtorBase DtorDerived DtorBDerived CtorBase CtorBase CtorBase DtorDerived DtorBase DtorCDerived CtorBase CtorBase DtorDerived DtorDBase CtorDerived CtorBase CtorBase DtorDerived DtorBase DtorAnswerDMarks2UnitIIId86QuestionWhat will be the output of the program?#include <iostream>using namespace std;class F1 {public:F1() { cout <<"F1 ctor "; }~F1() { cout <<"F1 dtor "; }};class F2 : public F1 {public:F2() { cout <<"F2 ctor "; }~F2() { cout <<"F2 dtor "; }};class F3 : public F1 {const F2 &f2;public:F3() : f2(*new F2) { cout <<"F3 ctor "; }~F3() { cout <<"F3 dtor "; }};int main() {F3 f3;return 0;}AF1 ctor F2 ctor F3 ctor F3 dtor F2 dtor F1 dtorBF1 ctor F1 ctor F2 ctor F3 ctor F3 dtor F1 dtorCF1 ctor F3 ctor F3 dtor F1 dtorDF1 ctor F1 ctor F2 ctor F3 ctor F3 dtor F2 dtor F1 dtor F1 dtorAnswerBMarks2UnitIIId87QuestionWhat will be the output of the program?#include <iostream>using namespace std;class Room {int number;public:Room(int num = 0): number(num) { }void dimension() { cout <<number <<"Rooms "; }};class Building {public:Building() : ro(100) { }void Build() { ro.dimension(); }private:Room ro;};int main() {Building B;B.Build();return 0;}A0 RoomsB100 RoomsCCompilation Error: ro is privateDNone of the aboveAnswerBMarks2UnitIIId88QuestionWhat will be the output of the program?#include<iostream>using namespace std;class Shape {public:int x, y;Shape(int a = 0, int b = 0): x(a), y(b) {}void draw(){ cout <<x <<""<<y <<""; }};class Rectangle : public Shape {public:int w, h;Rectangle(int a = 5, int b = 6): w(a), h(b), Shape(7, 8) {}void draw(){ Shape::draw(); cout <<w <<""<<h ; }};int main() {Rectangle *r = new Rectangle(1,2);r->draw();return 0;}A0 0 1 2B7 8 1 2C7 8 5 6D0 0 5 6AnswerBMarks2UnitIIId89QuestionYou cannot change the precedence and associativity of an operator by overloading.ATRUEBFALSECDAnswerAMarks1UnitIIId90QuestionWhen deriving a class from with protected inheritance, public members of the base class become___________ members of the derived class, and protected members of thebase class become _____________ members of the derived class.Aprotected, protected.Bpublic, privateCprivate, privateDPrivate, protectedAnswerAMarks2UnitIIId91QuestionWhen deriving a class with public inheritance, public members of the base class become __________ members of the derived class, and protected members of the base class become ___________members of the derived class.Aprivate, privateBpublic, protected.Cprotected, protected.Dprivate, protectedAnswerBMarks2UnitIIId92QuestionC++ provides for ________________, which allows a derived class to inherit from many base classes, even if the base classes are unrelated.AMultilevel inheritanceBSingle level inheritanceCmultiple inheritanceDHierarchical inheritance AnswerCMarks1UnitIIId93Question__________________is a form of software reuse in which new classes absorb the data and behaviors of existing classes and embellish these classes with new capabilities.AData hidingBInheritanceCAbstractionDencapsulation AnswerBMarks1UnitIIId94QuestionWe can create the object of abstract classATrueBFalseCDAnswerBMarks1UnitIIId95QuestionAll virtual functions in an abstract base class must be declared as pure virtual functions.ATRUEBFALSECDAnswerBMarks1UnitIIId96QuestionA class is made abstract by declaring that class virtual.ATRUEBFALSECDAnswerBMarks1UnitIIId97QuestionPolymorphic programming can eliminate the need for switch logic.ATRUEBFALSECDAnswerAMarks1UnitIIId98QuestionSuppose a and b are integer variables and we form the sum a + b. Now suppose c andD are floating-point variables and we form the sum c + d. The two +operators here areclearly being used for different purposes. This is an example of ____________AOperator OverloadingBInheritanceCFunction OverloadingDConstructorAnswerAMarks1UnitIIId99QuestionThe operators that cannot be overloaded isA*B-C::D()AnswerCMarks1UnitIIId100QuestionThe operators that cannot be overloaded isA*B?:C>>D<<AnswerBMarks1UnitIIId101QuestionWhich of the following operator(s) can not be overloadedA.*B::C?:DAll of the aboveAnswerDMarks1UnitIIId102QuestionWhich of the following is true about this pointer?AIt is passed as a hidden argument to all function callsBIt is passed as a hidden argument to all non-static function callsCIt is passed as a hidden argument to all static functionsDNone of the aboveAnswerBMarks1UnitIIId103QuestionPredict the output of following C++ program.#include<iostream>using namespace std;class Test{private: int x;public: Test(int x = 0) { this->x = x; } void change(Test *t) { this = t; } void print() { cout <<"x = "<<x <<endl; }};int main(){ Test obj(5); Test *ptr = new Test (10); obj.change(ptr); obj.print(); return 0;}Ax = 5Bx = 10CCompiler ErrorDRuntime ErrorAnswerCMarks2UnitIIId104QuestionWhich of the followings is/are automatically added to every class, if we do not write our own.ACopy ConstructorBAssignment OperatorCA constructor without any parameterDAll of the aboveAnswerDMarks2UnitIIId105QuestionWhat is the output of following program?#include<iostream>using namespace std;class Point { Point() { cout <<"Constructor called"; }};int main(){ Point t1; return 0;}ACompiler ErrorBRuntime ErrorCConstructor calledDSegmentation FaultAnswerAMarks1UnitIIId106QuestionWhat will be the output of following program?#include <iostream>using namespace std;class Test{public: Test() { cout <<"Hello from Test() "; }} a;int main(){ cout <<"Main Started "; return 0;}AMain StartedBMain Started Hello from Test()CHello from Test() Main StartedDCompiler Error: Global objects are not allowedAnswerCMarks2UnitIIId107QuestionWhich of the following operators are overloaded by default by the compiler?1) Comparison Operator ( == )2) Assignment Operator ( = )ABoth 1 and 2BOnly 1COnly 2DNone of the twoAnswerCMarks1UnitIIId108QuestionA normal C++ operator that acts in a special way on newly defined data types is called _______A EncapsulatedB OverloadedC ClassifiedD InheritedAnswerBMarks1UnitIIId109QuestionThe correct function name for overloading the addition + operator is __A Operator _+B Operator :+C Operator (+)D Operator +AnswerDMarks1UnitIIId110QuestionWhich of the following operators cannot be overloaded?A → operatorB . operatorC [ ] operatorD&operatorAnswerBMarks1UnitIIId111QuestionWhich of the following operators cannot be overloaded?A +B -C [ ]D ::AnswerDMarks1UnitIIId112QuestionPick the incorrect statement from the followingA The overloaded operators follow the syntax rules of original operator.B Only existing operators can be overloadedC Overloaded operator must have at least one operand of its class typeD Overloaded operators can change the meaning of the original operatorAnswerDMarks1UnitIIId113QuestionFor operators to be overloaded as non static member functions:A Both binary and unary operators take one argument.B Binary operators can have one argument and unary operators can not have anyC Neither binary nor unary operators can have argumentsD Binary operators can have two arguments and unary operators can have oneAnswerBMarks1UnitIIId114QuestionWhich of the following is an operator function?A Member overloadingB Function overloadingC Operator overloadingD None of theseAnswerCMarks1UnitIIId115QuestionOperator overloading means _______AGiving new meaning to existing operator without changing its originalMeaningB Making C++ operators to work with objectsC Making new types of operatorD Both a and bAnswerDMarks1UnitIIId116QuestionFor overloading =+ implicitly _______A + and = operators need to be overloaded implicitlyB Only + operator need to be overloaded implicitlyC Only = operator need to be overloaded implicitlyD The += operator cannot be overloaded implicitlyAnswerDMarks1UnitIIId117QuestionOverloading a postfix increment operator by means of a member function takes-------A No argumentB One argumentC Two argumentsD Three ArgumentsAnswerAMarks1UnitIIId118QuestionIf you overload only prefix operator ++ then the postfix ++ operator is ______A Does not workB Works arbitrarilyC Works naturallyD Works as if prefix ++ operatorAnswerDMarks1UnitIIId119QuestionWhen compiler decides binding of an overloaded member then it is called________A Static bindingB Dynamic bindingC Local bindingD None of theseAnswerAMarks1UnitIIId120QuestionOne can redefine the working of _______ to work with objects.A Preprocessor directivesB White space charactersC Standard operatorsD None of theseAnswerCMarks1UnitIIId121QuestionChoose the correct option:I. When you overload <<operator the >>operator automatically getsoverloadedII. You can overload unary operator to work with binary operatorA Only I is trueB Only II is trueC Both I and II are trueD Neither I nor II are trueAnswerDMarks1UnitIIId122QuestionChoose the correct optionI.If you do not want to make use of operator overloading, you can achieve that effect using user defined functionII. The sizeof operator can be overloadedAOnly I is trueB Only II is trueC Both I and II are trueD Neither I nor II are trueAnswerAMarks1UnitIIId123QuestionThe array subscript operator [] when overloaded cannot ______A Take user defined objects are operandsB Take float as an operandC Take multiple values inside (for example: [5,7] )D None of theseAnswerCMarks1UnitIIId124QuestionThe prototype of overloaded cast operator functions do not _______Aspecify the type they convert toBspecify the return typeCneed to be defined inside the class whose objects are being convertedDnone of theseAnswerBMarks1UnitIIId125QuestionWhich of the following operators cannot be overloaded ?A+=B<<C?:DFUNCTION CALL()AnswerCMarks1UnitIIId126QuestionWhich of the following operators cannot be overloaded ?A ::B SizeofC Conditional operator ?:D All of theseAnswerDMarks1UnitIIId127QuestionThe overloading the function operator________.A requires class with overloaded operatorsB makes use of parameterized constructorC allows to create objects that are syntactically like functionsD none of theseAnswerAMarks1UnitIIId128QuestionChoose the incorrect statement from the following.A Constructors can be overloaded.B Only existing operators must be overloadedC the overloaded operators must follow the syntax rules of the original operatorD The overloaded operators must have atleast one operand of its class typeAnswerBMarks1UnitIIId129QuestionOverloading without explicit arguments to an operator function is called______.A unary operatorB binary operatorC nested classD none of theseAnswerAMarks1UnitIIId130QuestionIn binary overloaded function which are overloaded through friend function take_______A three explicit argumentsB two explicit argumentsC one explicit argumentD no argumentAnswerBMarks1UnitIIId131QuestionIn binary overloaded function which are overloaded through member function take__________A three explicit argumentsB two explicit argumentsC one explicit argumentD no argumentAnswerCMarks1UnitIIId132QuestionThe unary operators are overloaded by member function then it takes ______A three explicit argumentsB two explicit argumentsC one explicit argumentD no argumentAnswerDMarks1UnitIIId133QuestionChoose the correct choice.I. All the operators in C++ can be overloaded.II. We can change the basic meaning of operator while overloading it.A Only I is trueB Only II is trueC Both I and II are trueD Neither I nor II are trueAnswerDMarks1Unit2Id134QuestionWhich of the following operator can be overloaded through friend function ?A ::B +C =D ->AnswerBMarks1UnitIIId135QuestionThe name of the operator function that overloads the / symbol is________.A operator /()B /op()C / operator()D op/()AnswerAMarks1UnitIIId136QuestionIn binary operator overloaded operator function the second operand should be______.A passed by valueB ImplicitC passed by referenceD none of theseAnswerCMarks1UnitIIId137QuestionFunction overloading is run time polymorphismsATrueBFalseCDAnswerBMarks1UnitIIId138QuestionFollowing overloaded operator cannot be inherited by derived class_______.A>B =C *D /AnswerBMarks1UnitIIId139QuestionChoose the correct choice.AThe conditional operator can be overloadedB While overloading using the friend function the binary operator requires one argumentC Operator precedence cannot be changedD None of theseAnswerCMarks1UnitIIId140QuestionWhich of the following operator can be overloaded through friend function ?A()B []C ->D *AnswerDMarks1UnitIIId141QuestionWhen we overload we want to______.A compare and copy objectB assign one object to anotherC compare two objectsD test for equalityAnswerBMarks1UnitIIId142QuestionOperator overloading is also called one form of polymorphism because_______.A the overloaded operators have many formsB the overloaded operators can be declared virtualC the overloaded function can perform various tasks depending upon the type of objectDNone of theseAnswerCMarks1UnitIIId143QuestionOverloading meansA two or more methods in the same class that have same nameB calling the method which has actual parametersC two or more methods having same name but present in different classD none of theseAnswerCMarks1UnitIIId144QuestionThe inheritance mechanism provides meaning of deriving______A new operator from exciting oneB new function from exciting oneC new class from exciting oneD all of theseAnswerCMarks1UnitIIId145QuestionA class derived from the exciting class is known as______A new classB InheriteeC derived classD none of theseAnswerCMarks1UnitIIId146QuestionThe derived class is derived from__________A derived classB base classC both a&bD none of theseAnswerBMarks1Unit2Id147QuestionWhich of the following can be derived from base class in inheritace ?A data membersB member functionCboth a&bD none of theseAnswerCMarks1UnitIIId148QuestionThe inheritance is described as a _____ relationshipA has aB is aC associationD none of theseAnswerBMarks1UnitIIId149QuestionWhich of the following allows you to create derived class that inherits properties from more than one base class ?A multilevel inheritanceB multiple inheritanceC single inheritanceD Hybrid inheritanceAnswerBMarks1UnitIIId150QuestionThe principle by which the knowledge of general category can be applied to more specific objects is called _____ApolymorphismB overridingC inheritanceD none of theseAnswerAMarks1UnitIIId151QuestionParent:child is________A base:derivedB derived:drivenC child:superD subclass:superclassAnswerAMarks1UnitIIId152QuestionWhat is the syntax of inheritance of a class ?A Class class _nameB Class name:access specifierC Class name:access specifier class nameD none of theseAnswerCMarks1UnitIIId153QuestionIf an attribute is private then which methods have access to it?A Only static methods in the same classB Only the methods defined in that classC Only the methods of the same packageD none of theseAnswerBMarks1UnitIIId154QuestionWhich of the following advantage cannot be achieved by using multiple inheritance?A polymorphismB dynamic bindingC both a&bD none of theseAnswerCMarks1UnitIIId155QuestionWhich of the symbol used to create multiple inheritance ?A DotB CommaC Hash #D DollarAnswerBMarks1UnitIIId156QuestionUsing multiple inheritanceA there can be virtual classB it can not be include virtual classC the base classes must have only default constructorD none of theseAnswerAMarks1UnitIIId157QuestionThe______member function is declared in base class but redefined in derived classA classB overloadedC operatorD virtualAnswerDMarks1UnitIIId158QuestionIn public inheritance ______A All the members of base class are inherited and are made publicB Members of base class that are not private are inherited and retain their access typeC All the members of base class are inherited and retain their access typeD Only public members of base class are inherited and they remain publicAnswerCMarks1UnitIIId159QuestionIf class C is derived class of class B and class B is a derived class of A. If we instantiate class B object then the first constructor called belongs to classA AB BC can be A or BD one cannot achieve such inheritanceAnswerAMarks1UnitIIId160QuestionWhen the object of derived class expire, first the _______ is invoked followed by the ________.A derived class constructor, base class destructorB derived class destructor , base class destructorCbase class destructor , derived class destructorD none of theseAnswerBMarks1UnitIIId161QuestionIf class A inherits from class B then B is called ________ ans A is called ________ of B.A superclass and subclassB subclass and superclassC subclass and child classD superclass and parent classAnswerAMarks1UnitIIId162QuestionWhat does derived class does not inherit from the base class _______.A constructor and destructorB operator=() membersC friendsD all of theseAnswerDMarks1UnitIIId163QuestionWhich constructor will initialise the base class data member ?A Base classB Derived classC Derived derived classD None of theseAnswerAMarks1UnitIIId164QuestionIf class A is a friend class of class B, if class B is friend class of class C then_______A class C is friend class ofB class A is friend class ofC class A and class C do not have any friendship relation.D none of theseAnswerCMarks1UnitIIId165Question_________ class is tightly coupled with other class.A friendB virtualC abstractD none of theseAnswerAMarks1UnitIIId166QuestionThe keyword friend is used in ___________.A the class allowing access to another classB the private section of a classC the public section of a classD all of theseAnswerDMarks1UnitIIId167QuestionClass Test:public A, public B is an example of multiple inheritance.AFalseBTrueCDAnswerBMarks1UnitIIId168QuestionWhich of the following interface determines how your program will be used by other program?A PublicB PrivateC ProtectedD None of theseAnswerAMarks1UnitIIId169QuestionWhen base class pointer points to derived class object___________Ait can access only base class membersBit can access only derived class membersCboth base class &derived class membersDNone of theseAnswerAMarks1UnitIIId170QuestionThe base class will offer_____A more specific object than the derived classB more generalized version of its derived classC empty templates of its derived classD none of theseAnswerBMarks1UnitIIId171QuestionIn my program I have overloaded TEST::operator+ and TEST::operator= What is the effect on TEST::operator+= ?A The TEST::operator+= will be automatically overloaded .first TEST::operator+ will get overloaded and then TEST::operator=B The TEST::operator+= will be automatically overloaded .first TEST::operator= will get overloaded and then TEST::operator+CTEST::operator+= will made invalidD There will be no effect because all three are independentAnswerDMarks1UnitIIId172QuestionWhat will happen on execution of the following code ?Class base{};class derived: protected base{};A It will not compile as the class body of the base class is not definedB It will not compile as the class body of the derived class is not definedC It will compile successfullyD The compilation of above code is dependent upon the type of data provided to itAnswerCMarks1UnitIIId173QuestionThe base class will offer_____A more specific object than the derived classB more generalized version of its derived classC empty templates of its derived classD none of theseAnswerBMarks1UnitIIId174QuestionThe hybrid inheritance is _____A multiple inheritanceB multilevel inheritanceC multipath inheritanceD both a &cAnswerDMarks1UnitIIId175QuestionHow many types of inheritance are thereA 1B 2C 4D 5AnswerDMarks1UnitIIId176QuestionChoose the correct optionAa) a constructor can not be called explicitlyBb) a destructor is not inheritedCc) constructor can not be inheritedDd) All of theseAnswerDMarks1UnitIIId177QuestionSuppose class derived is derived from a class Base. Both the classes contain theFunction name display() that take no argument. What will be the statement in the class derived which will called the display function of base classADisplay()BBase:display()CBase ::display()DCan make such a cellAnswerCMarks1UnitIIId178QuestionSuppose class derived is derived from a class Base privately. The object of class Derived is located in main() can access_______.A public members of baseBprivate member of baseC protected members of baseD public members of derivedAnswerDMarks1UnitIIId179QuestionMultiple inheritance causes for a derived class to have ___members.A ambiguousB publicC privateD protectedAnswerAMarks1UnitIIId180QuestionWhat will be the first line of specifier for the class tier, wheel &rubber. Make use of public rubberA Class Tier:public wheel, public rubberB Class wheel:public tier, public rubberC Class rubber:public tier, public wheelD none of theseAnswerAMarks1UnitIIId181QuestionWhich is the correct class defination for class C ,Which inherits from A &B classesA Class C:A,BB Class C::A,BC Class C:public A,public BD Class C:: public A,Public BAnswerCMarks1UnitIIId182QuestionThe ability of function or operator to act in different ways on different data type is called___________A inheritanceB polymorphismC encapsulationD none of theseAnswerBMarks1UnitIIId183Question_____class that declares or inherits a virtual function.A Encapsulation dataB Inherited classC Polymorphic classD none of theseAnswerCMarks1UnitIIId184QuestionChoose the correct option.A A base class may have more then one derived classB Derived class may have more than one derived classC Both a &bD Neither a nor bAnswerCMarks1UnitIIId185Questionreusability is provided by which feature of c++ApolymorphismsBabstractionCderivationDnone of the aboveAnswerCMarks1UnitIIId186QuestionWhat types of derivations are supported by c++?AsingleBmultipleCmultilevelDall of the aboveAnswerDMarks1UnitII ................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- paper title use style paper title
- objective questions for maths
- chp cpa diary
- microsoft word 3 part spec fgbi with
- topic 1 social psychology content ajw
- ap statistics math for life
- chapter 7 financial budgeting cpa diary
- file chap11 chapter 11 community health
- health and wellbeing survey worksafe tasmania
- the vax basic architecture jmu
Related searches
- wordpress passing data between pages
- wordpress business templates
- wordpress rss feed not working
- wordpress jquery is not defined
- create wordpress blog
- wordpress roles editor
- wordpress full rss feed
- wordpress rss feed settings
- wordpress rss feed plugin
- wordpress display rss feed
- wordpress rss feed link
- wordpress rss feed to post