Please answer the following as true or false: 1. The constructor of a derived cl
ID: 3558133 • Letter: P
Question
Please answer the following as true or false:
1. The constructor of a derived class can directly access the private data members of the base class
2. In composition, one or more members of a class are objects of another class type.
3. Polymorphism is the ability to create new objects from existing objects.
4. In C++, virtual functions are declared using the reserved word virtual.
5. A friend function does not have access to the private data members of the class.
6. A template instantiation can be created with either a built-in or user-defined type.
7. You should always use the mechanism of separating the class definition and the definitions of the member functions to work with class templates.
Explanation / Answer
1. False
(We need to use protected in this case)
2. True
(definition of composition)
3. False
(polymorphism is the provision of a single interface to entities of different types.)
4. True
5. False
6. True
7. False
(not possible to separate in case of templates)