Exercise

1.Which value is placed in the base class?

A. Derived values
B. Default type values
C. Both default type & derived values
D. None of the above

View Answer


2. What is a template?

A. A template is a formula for creating a generic class
B. A template is used to manipulate the class
C. A template is used for creating the attributes
D. None of the above

View Answer


3.Which of the following best defines the syntax for template function ?

A. template return_type Function_Name(Parameters)
B. template
return_type Function_Name(Parameters)
C. Both a and b
D. None of the above

View Answer


4.Templates are abstract recipe for producing a concrete code, and it is used for

A. Producing functions
B. Producing classes
C. Nothing
D. Both A and B

View Answer


5.How many parameters are legal for non-type template?

A. 1
B. 2
C. 3
D. 4

View Answer


6. How many kinds of entities are directly parameterized in c++?

A. 1
B. 2
C. 3
D. 4

View Answer


7.From where does the template class derived?

A. Regular non-templated C++ class
B. Templated class
C. A or B
D. None of the above

View Answer


8.Can we have overloading of the function templates?

A. Yes
B. No

View Answer


9. A container class is a class whose instances are

A. Containers
B. Functions
C. Strings
D. None of the above

View Answer


10.Which of the things does not require instantiation?

A. Functions
B. Non virtual member function
C. Member class
D. All of the above

View Answer


11.How many bits of memory needed for internal representation of class?

A. 1
B. 2
C. 4
D. No memory needed

View Answer


12. Which value is placed in the base class?

A. Derived values
B. Default type values
C. Both A & B
D. None of the above

View Answer


13.What is other name of full specialization?

A. Explicit specialization
B. Implicit specialization
C. Function overloading template
D. None of the above

View Answer


14.A common activity performed on a container is called

A. Functioning
B. Iterator
C. Traversal
D. All of them

View Answer


15.How many types of templates are there in c++?

A. 1
B. 2
C. 3
D. 4

View Answer


16. Which is dependant on template parameter?

A. Base class
B. Abstract class
C. Method
D. None of the above

View Answer


17. Pick out the correct statement about string template?

A. It is used to replace a string.
B. It is used to replace a string with another string at runtime.
C. It is used to delete a string.
D. None of the above

View Answer


18.Containers have the same types, that's why they are called

A. Heterogeneous
B. Homogeneous
C. Vectors
D. None of them

View Answer


19.How many bits of memory needed for internal representation of class?

A. 1
B. 2
C. 4
D. No memory needed

View Answer


20.What can be passed by non-type template parameters during compile time?

A. Int
B. Float
C. Constant expression
D. None of the above

View Answer




Discussion

* You must be logged in to add comment.