Skip to content
VUBuddy

CS304 Quiz 4 by Mubi

Object Oriented Programming PDF 848 KBUpdated 23 Oct 2026
Quiz CS304 Quiz 4 by Mubi PDF 848 KB
vubuddy.com
Type
Quiz
Course
CS304 Object Oriented Programming
Size
PDF 848 KB
Updated
23 Oct 2026
Free download 0 of 3 used today
Download free · 848 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 3. Download the file for all 3 pages.

Q1. Which of the following is pure virtual function?

  1. void print() = 0;
  2. virtual void print() = 0;
  3. virtual void print();
  4. void print();

Correct answer: virtual void print() = 0;

Q2. What does the virtual keyword ensure when used in a base class function in C++?

  1. Early binding
  2. Constructor overloading
  3. Static function resolution
  4. Dynamic binding

Correct answer: Dynamic binding

Q3. In statement "template <class T, class U, int I = 5>" ,the non-type parameter is _____________.

  1. int I
  2. class T
  3. class U
  4. All of the given options

Correct answer: int I

Q4. Which of the following function can convert a class into an abstract class?

  1. Virtual function
  2. Abstract function
  3. Pure virtual function
  4. Concrete function

Correct answer: Pure virtual function

Q5. Which statement will be true for concrete class?

  1. It cannot be inherited from an abstract class.
  2. It can be instantiated.
  3. It cannot be instantiated.
  4. None of given options.

Correct answer: It can be instantiated.

Q6. In C++, dynamic binding and polymorphism will be achieved when member function will be ____.

  1. private
  2. virtual
  3. public
  4. inline

Correct answer: virtual

Q7. Which class has at least one pure virtual function?

  1. Child class
  2. Abstract class
  3. Concrete class
  4. Template class

Correct answer: Abstract class

Q8. Each ___________ of a template class by default becomes function template.

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

Correct answer: Member function

Q9. 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 >

Correct answer: template< int , char >

Q10. Which of the following represents partial specialization?

  1. template< int , char >
  2. template< class T, type T>
  3. template< typename T, class W >
  4. template< class T, class U, int >

Correct answer: template< typename T, class W >

Q11. <p>__________ binding means that target function for a call is selected at compile time.</p>

  1. <p>Dynamic</p>
  2. <p>Static</p>
  3. <p>Automatic</p>
  4. <p>Default</p>

Correct answer: <p>Static</p>

Q12. Polymorphism always works with ___________.

  1. actual objects
  2. static objects
  3. pointer to class objects
  4. constant objects

Correct answer: pointer to class objects

Q13. Which of the following is correct code to instantiate the object of given template Vector class for int type?

template <class T>

class Vector

A. Vector int obj; B. Vector obj <int>;

C. Vector <int> obj;

D. Vector obj<>int;

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

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

Correct answer: template< typename T, typename U >

Q15. ___________ binding means that target function for a call is selected at run time.

  1. Dynamic
  2. Constant
  3. Automatic
  4. Static

Correct answer: Dynamic

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

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

Correct answer: *

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.