Skip to content
VUBuddy

CS304 Quiz 2 Solution by MCS

Object Oriented Programming PDF 338 KBUpdated 23 Oct 2026
Quiz CS304 Quiz 2 Solution by MCS PDF 338 KB
vubuddy.com
Type
Quiz
Course
CS304 Object Oriented Programming
Size
PDF 338 KB
Updated
23 Oct 2026
Free download 0 of 3 used today
Download free · 338 KB

You get 3 free files a day on the website. Add the Chrome extension for 30 a day.

Unlimited downloads in the Android app Get it free on Google Play

Preview text

Text from pages 1, 2, 3 of 5. Download the file for all 5 pages.

CS304 Quiz No.2 Spring 2020 by MCS of Virtuallians

Q1. The parameters given in temple definition other than those used for mentioning templates types are called ________

  1. Type Parameters
  2. Non Type parameters
  3. Default Type Parameters
  4. None of the given option

Q2. Which of the following is the correct way to define a template class X?

  1. Class < typename T>class X{}
  2. Template class C{}
  3. Template < typename T> classX{}
  4. Typename<class T > class X{}

Q3. In resolution order of function template, compiler searches for _______in the end

  1. Complete specialization
  2. Partial specialization
  3. Ordinary function
  4. Generic template

Q4. ___________may inherit from a complete specialization

  1. Partial specialization
  2. Complete specialization
  3. Ordinary class
  4. All of given options

Q5. Which of the following may inherit form the ordinary class?

  1. Class template
  2. Partial specialization
  3. Complete specialization
  4. All of given option

Q6. Which of the following is a sequence container?

  1. Map
  2. Vector
  3. Set
  4. multiset

Q7. Each ____________of a template class by default becomes function template

  1. Date member
  2. Member function
  3. Type parameter
  4. Object

Q8. When we specialize a function template, it is called __________________

  1. Function overloading
  2. Function overriding
  3. Function template overloading
  4. Function template overriding

Q9. Which of the following is NOT an associative container?

  1. Set
  2. Multiset
  3. Map
  4. Group

Q10. A ____________is a pointer which is declared outside the ________

  1. Container, cursor
  2. Cursor, container
  3. Container, class
  4. This, cursor

Q11. Which of the following are collectively referred to as the first class containers?

  1. Associative containers and containers adapters
  2. Sequence containers and associative containers
  3. Sequence containers and container adapters
  4. None of the given options

Q12. ________ class is a single class that provides functionality to operate on different type of data

  1. Friend
  2. Template
  3. Ordinary
  4. None of the give options

Q13. Which of the following can be passed as type argument to template?

  1. Primitive type
  2. User defined types
  3. Both primitive type and user defined types
  4. None of the given options

Q14. Which of the following is known as Dereference operator in C++?

  1. +
  2. *
  3. &
  4. ::

Q15. We can change behavior of template using___________

  1. Template parameters
  2. Function parameters
  3. Class Templates
  4. none of the given options

Q16. Which of the following represents partial specialization?

  1. Template < int, char >
  2. Template < class T, Type t>
  3. Template<class T, Class U, int>
  4. Template< typename T, class W>

Q17. When we declare template function as friend of any class, then which of the following specialization(s) of template function also become friend of the class granting friendship?

  1. Explicit
  2. Implicit
  3. Partial
  4. All of the given options

Q18. In statement “template <class T, class U, int I = 5>” then non-type parameters is

  1. Class T
  2. Class U
  3. int I
  4. All of the given option

Q19. Which of the following is the correct syntax for passing two type argument to a template?

  1. template < type T, type U>
  2. template < typename T, typename U>
  3. template <type T,U>
  4. template Typename < T,U >

Q20. Which of the following represents complete specialization?

  1. Template < int, char >
  2. Template < class T, float>
  3. Template<class T, Class U , int>
  4. Template< class , class W>

Q21. Which of the following is/are the key component of standard template library?

  1. Containers
  2. Iterators
  3. Algorithm
  4. All of the given option

Q22. Which of the following statement is true about partial specialization?

  1. Function templates cannot have partial specialization
  2. Class template cannot have partial specialization
  3. Both class templates and function template can have partial specialization.
  4. None of the given

Q23. Which of the following is correct code portion to initialize static data member “value” of int type for class X?

  1. Template <class T> X::value =0;
  2. Template<class T>int X::value =0;
  3. Template<class T> int X < T >::value = 0;
  4. Template<class T> X < T >::value =0;

Q24. When we want to have exactly identical operations on different data type, ________are used

  1. Function Template
All CS304 files →
CS304 Object Oriented Programming All CS304 handouts, past papers, quizzes and MCQs in one place. Open course page

Get more out of VUBuddy, for free

Android app Free on Google Play
  • Unlimited downloads
  • The explanation behind every MCQ answer
  • Study offline on slow data
Get the Android app
Chrome extension Free on the Chrome Web Store
  • 30 downloads a day instead of 3
  • Sign in and buy Pro Semester here
Add to Chrome

One Pro Semester membership works in both the extension and the app.