CS-304 Final Term Exams Preparation Virtual University With Answers

CS-304 Final Term Exams Preparation Virtual University

Sr. # Questions Answers Choice
1 An abstract class is useful when We do not derive any class from it. There are multiple paths from one derived class to another. We do not want to instantiate its object You want to defer the declaration of the class.
2 The mechanism of selecting function at run time according to the nature of calling object is called, late binding static binding virtual binding None of the given options
3 Two important STL associative containers are _______ and _______. set,map sequence,mapping setmet,multipule sit,mat
4 When the base class and the derived class have a member function with the same name, you must be more specific which function you want to call (using ___________). scope resolution operator dot operator null operator Operator overloading
5 When a subclass specifies an alternative definition for an attribute or method of its superclass, it is _______ the definition in the superclass. overload overriding copy riding none of given
6 Which of the following operators always takes no argument if overloaded? / - + ++
7 When a variable is define as static in a class then all object of this class, Have different copies of this variable Have same copy of this variable Can not access this variable None of given
8 Consider the code below, class Fred { public: Fred(); ... }; int main() { Fred a[10]; Fred* p = new Fred[10]; ... } Select the best option Fred a[10]; calls the default constructor 09 times Fred* p = new Fred[10]; calls the default constructor 10 times Produce an error Fred a[10]; calls the default constructor 11 times Fred* p = new Fred[10]; calls the default constructor 11 times Fred a[10]; calls the default constructor 10 times Fred* p = new Fred[10]; calls the default constructor 10 times
9 Consider a class named Vehicle, which of the following can be the instance of class Vehicle? 1. Car 2. Computer 3. Desk 4. Ahmed 5. Bicycle 1, 4, 5 2, 5, 6 1, 2, 3, 6 1, 5, 6
10 In case of multiple inheritance a derived class inherits, Only the public member functions of its base classes Only the public data members of its base classes Both public data members and member functions of all its base classes Data members and member functions of any two base classes
Download This Set

Is this page helpful?