Which of the following is true about templates? 1) Template is a feature of C++ that allows us to write one code for different data types. 2) We can write one function that can be used for all data types including user defined types. Like sort(), max(), min(), ..etc. 3) We can write one class or struct that can be used for all data types including user defined types. Like Linked List, Stack, Queue,..etc. 4) Template is an example of compile time polymorphism.

Question:
Which of the following is true about templates?
1) Template is a feature of C++ that allows us to write one code for different data types.
2) We can write one function that can be used for all data types including user defined types. Like sort(), max(), min(), ..etc.
3) We can write one class or struct that can be used for all data types including user defined types. Like Linked List, Stack, Queue,..etc.
4) Template is an example of compile time polymorphism.

1.1 and 2

2.1, 2 and 3

3.1, 2 and 4

4.1, 2, 3 and 4

Posted Date:-2022-07-04 13:14:21


More MCQS Questions and answers

Search
Olete Team
Online Exam Test Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on Online Exam Test website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!