1. A class or class template can have member ___ that are themselves templates.
- variable
- function
- objects
- none
2. Select the correct line of code for composition relationship between “Keyboard” class and “Keys” class
- class keyboard{Keys type;};
- class keys{KeyBoard type;};
- class keyboard : private keys
- class keys: private KeyBoard
3. “A fan has wings”. Which type of relationship exists between fan and wings?
- Aggregation
- Association
- Composition
- Inheritance
4. Consider the following two lines of code written for a class Student,
1. Student sobj1;
2. Student sobj2(sobj1);
In line No. 2 what constructor of Student class will be called,
- Default constructor
- Copy constructor
- Both Default and Copy
- No constructor will be called
5. Consider the following two lines of code written for a class Student,
1. Student sobj1;
2. Student sobj2=sobj1;
In line No. 2 what constructor of student class will be called,
- Default constructor
- Copy constructor
- Both Default and Copy constructor
- None
6. Which of the following function can convert a class into an abstract class?
- Abstract function
- Concrete function
- Virtual function
- Pure virtual function
7. A class with no pure virtual function is a ___ class.
- Concrete
- Abstract
- Virtual
- None
8. Select the correct line of code for composition relationship between “Person” class and “Nationality” class.
- class Nationality {Person p};
- class Person {Nationality c};
- class Person: private Nationality
- class Nationality: private Person
9.
10.