Quiz on Templates

Test your understanding of templates in C++ by taking this quiz.

1

Which of the following is true about templates?

1) Template allows code to be written for different data types.
2) A single function can be used for all data types including user defined types.
3) One class can be used for all data types including user defined types.
4) Template is example of compile time polymorphism
A)

1 and 2

B)

1,2 and 3

C)

1,2 and 4

D)

1,2,3 and 4

Question 1 of 40 attempted

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy