Question 39Asked in UGC NET Computer Science, November 2017 (Paper II & III, Selected Questions)

Which of the following is not correct (in C++)?

  1. AClass templates and function templates are instantiated in the same way
  2. BClass templates differ from function templates in the way they are initiated
  3. CClass template is initiated by defining an object using the template argument
  4. DClass templates are generally used for storage classes
Show answerHide answer

Correct answer: (A) Class templates and function templates are instantiated in the same way

Explanation

Function templates are instantiated implicitly when the function is called with arguments, whereas class templates are instantiated by defining an object with explicit template arguments. So class templates and function templates are not instantiated in the same way; statement (a) is not correct.

From UGC NET Computer Science PYQ, November 2017 (Paper II & III, Selected Questions)

This is question 39 of UGC NET Computer Science PYQ, November 2017 (Paper II & III, Selected Questions). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.