To convert from a user-defined class to a basic type, you would most likely use
► a built-in conversion operator.
► a one-argument constructor.
► an overloaded = operator. (May be this one)
► a conversion operator that’s a member of the class. (May be this one)
Q. 4
A C++ class is similar to --------------------
► Structure
► Header File
► Library File
► None of the given
Q. 5
A class can be identified from a statement by -------------
►Noun (Page 58)
►Pronoun
►Verb
►Adverb
Q. 6
Suppose there is an object of type Person, which of the following can be considered as one of its attributes
► Name
► Age
► Work()
► Both Name and Age (page 13)
Q. 7
Assume a class C with objects obj1, obj2, and obj3. For the statement obj3 = obj1 - obj2 to work correctly, if the overloaded - operator must
► take two arguments. (Doubted)
► return a value (Doubted)
► create a named temporary object.
► take four arguments
Q. 8
Using encapsulation we can achieve
► Information hiding, least interdependencies & implementation dependence
► Inheritance, Information Hiding, Abstraction
► Information Hiding, Polymorphism, Abstraction
►
Q. 9
Abstraction is
►
►
►
►
Q. 10
Abstract Class has
► Zero Instance
► One Instance
► Two Instance
► Many Instance
Q. 11
If constructor in not initialized then
► Compiler will give error message
► Compiler will give warning
► Compiler will initialize zero by default
►
Q. 21 (2)
Differentiate Unary & Binary operators from the followings:
%, &, &&, *, --, =, /
Q. 22 (2)
What is “anonymous base class” object? Explain with example
Q. 23 (3)
Justify the statement “getter is the good programming practice”.
Q. 24 (3)
Give C++ code to overload assignment operator for string class
Q. 25 (5)
How we resolve the following problems in overloading of assignment operator in string class, (explain with the help of c++ code) Self referencing Assigning a string value to more than one strings in a single line like, stringobject1 = string object2 = stringobject3 = stringobject4