Object Oriented Programming

Home Page
Q & A
1Inheritance is a way toorganize datapass arguments to objects of classesadd features to existing classes without rewriting themimprove data-hiding and encapsulationC
2To convert from a user-defined class to a basic type, you would most likely usea built-in conversion operatora one-argument constructoran overloaded = operatora conversion operator that‘s a member of the classC
3A C++ class is similar to --------------------StructureHeader FileLibrary FileNone of the givenA
4a‘A static member function can be called, even when a class is not __________DeclaredDefineInstantiatedCalledC
5Which one of the following features of OOP is used to derive a class from another?EncapsulationPolymorphismData hidingInheritanceD
6What is a class?A class is a section of computer memory containing objectsA class is a section of the hard disk reserved for object oriented programsA class is the part of an object that contains the variablesA class is a description of a kind of objectD
7The main function of scope resolution operator (::) is,To define an objectTo define a data memberTo link the definition of an identifier to its declarationAll of the givenB
8Which of the following operators always takes no argument if overloaded?/-+++D
9Assume a class C with objects obj1, obj2, and obj3. For the statement obj3 = obj1 - obj2 to work correctly, if the overloaded - operator musttake two argumentsreturn a valuecreate a named temporary objecttake four argumentsA
10The keyword that is used that the variable can not change state?staticconstfriendprivateB
11Suppose obj1 and obj2 are two objects of a user defined class A. An + operator is overloaded to add obj1 and obj2 using the function call obj1+obj2. Identify the correct function prototype against the given call?A operator + ( A &obj);int + operator();int operator (plus) ();A operator(A &obj3);C
12We can get only one unique value which can be used by all the objects of that class by the use of,static variablesdynamic variablesinstance variablesdata membersA
13A member function having the same name as that of a class and a ~ sign with it is called,ConstructorGetterSetterDestructorD
14Using encapsulation we can achieveInformation hidingLeast interdependencies among modulesImplementation independencAll of given optionsD
15The >= operator can be overloadedTrueFalseNANAA
16A static member function cannot be declaredStaticImplicitExplicitVirtualB
17Static variables act like a global variable in the context or scope of the classTrueFalseNANAA
18The compiler won‘t object if you overload the * operator to perform divisionTrueFalseNANAA
19We can use "this" pointer in the constructor in the body and even in the initialization list of any class if we are carefulTrueFalseNANAB
20Which operator can not be overloaded?The relation operator ( >= )Assignment operator ( = )Script operator ( [] )Conditional operator (? : )D
21An overloaded operator always requires one less argument than its number of operandsTrueFalseNANAB
22A generalization-specialization relation between classes are implemented usingdata hidingfriend classesencapsulationinheritanceD
23In OOP a class is an example of _____Data TypeAbstract TypeUser Defined TypeNone of the givenC
24Identify which of the following overloaded operator function‘s declaration is appropriate for the given call? Rational_number_1 + 2.325 Where Rational_number_1 is an object of user defined class Rational_numberRational_number operator+( Rational_number & obj);Rational_number operator+(double& obj);Rational_number operator+(Rational_number &obj, double& num);operator+(double& obj);B
25A class can be identified from a statement by -------------NounPronounVerbAdverbA