Podcast
Questions and Answers
Which of the following causes run time binding?
Which of the following causes run time binding?
Which of the following is the best approach if it is required to have more than one functions having exactly same functionality and implemented on different data types?
Which of the following is the best approach if it is required to have more than one functions having exactly same functionality and implemented on different data types?
A copy constructor is invoked when
A copy constructor is invoked when
Like template functions, a class template may not handle all the types successfully.
Like template functions, a class template may not handle all the types successfully.
Signup and view all the answers
A class template may inherit from another class template.
A class template may inherit from another class template.
Signup and view all the answers
By default the vector data items are initialized to ________.
By default the vector data items are initialized to ________.
Signup and view all the answers
In private ______ only member functions and friend classes or functions of a derived class can convert pointer or reference of derived object to that of parent object.
In private ______ only member functions and friend classes or functions of a derived class can convert pointer or reference of derived object to that of parent object.
Signup and view all the answers
Which one of the following terms must relate to polymorphism?
Which one of the following terms must relate to polymorphism?
Signup and view all the answers
By default the vector data items are initialized to
By default the vector data items are initialized to
Signup and view all the answers
A function template can not be overloaded by another function template.
A function template can not be overloaded by another function template.
Signup and view all the answers
Which of the following is the best approach to implement generic algorithms with minimum number of coding lines?
Which of the following is the best approach to implement generic algorithms with minimum number of coding lines?
Signup and view all the answers
Identify the correct way of declaring an object of user defined template class A for char type members?
Identify the correct way of declaring an object of user defined template class A for char type members?
Signup and view all the answers
The user must define the operation of the copy constructor.
The user must define the operation of the copy constructor.
Signup and view all the answers
Default constructor is such constructor which either has no ---------or if it has some parameters these have -------- values
Default constructor is such constructor which either has no ---------or if it has some parameters these have -------- values
Signup and view all the answers
The type that is used to declare a reference or pointer is called its
The type that is used to declare a reference or pointer is called its
Signup and view all the answers
How the information hidden within an object can be accessed?
How the information hidden within an object can be accessed?
Signup and view all the answers
The sub-object's life is not dependant on the life of master class in
The sub-object's life is not dependant on the life of master class in
Signup and view all the answers
Encapsulation means
Encapsulation means
Signup and view all the answers
Algorithms can only be implemented using STL containers.
Algorithms can only be implemented using STL containers.
Signup and view all the answers
When we write a class template the first line must be:
When we write a class template the first line must be:
Signup and view all the answers
An STL container can not be used to,
An STL container can not be used to,
Signup and view all the answers
Consider a class named Vehicle, which of the following can be the instance of class Vehicle?
Consider a class named Vehicle, which of the following can be the instance of class Vehicle?
Signup and view all the answers
Associativity can be changed in operator overloading.
Associativity can be changed in operator overloading.
Signup and view all the answers
A normal C++ operator that acts in special ways on newly defined data types is said to be
A normal C++ operator that acts in special ways on newly defined data types is said to be
Signup and view all the answers
Which operator can not be overloaded?
Which operator can not be overloaded?
Signup and view all the answers
Suppose obj1 and obj2 are two objects of a user defined class A. An + operator is overloaded to add obj1 and obj2 using the function call obj1+obj2. Identify the correct function prototype against the given call?
Suppose obj1 and obj2 are two objects of a user defined class A. An + operator is overloaded to add obj1 and obj2 using the function call obj1+obj2. Identify the correct function prototype against the given call?
Signup and view all the answers
Public methods of base class can --------be accessed in its derived class
Public methods of base class can --------be accessed in its derived class
Signup and view all the answers
If there is a pointer p to objects of a base class, and it contains the address of an object of a derived class, and both classes contain a nonvirtual member function, ding(), then the statement p->ding(); will cause the version of ding() in the ______ class to be executed.
If there is a pointer p to objects of a base class, and it contains the address of an object of a derived class, and both classes contain a nonvirtual member function, ding(), then the statement p->ding(); will cause the version of ding() in the ______ class to be executed.
Signup and view all the answers
When the base class and the derived class have a member function with the same name, you must be more specific which function you want to call (using ______ ).
When the base class and the derived class have a member function with the same name, you must be more specific which function you want to call (using ______ ).
Signup and view all the answers
Non Template Friend functions of a class are friends of ______ instance/s of that class.
Non Template Friend functions of a class are friends of ______ instance/s of that class.
Signup and view all the answers
In Private only member functions and friend classes or functions of a derived class can convert pointer or reference of derived object to that of parent object
In Private only member functions and friend classes or functions of a derived class can convert pointer or reference of derived object to that of parent object
Signup and view all the answers
In order to define a class template, the first line of definition must be:
In order to define a class template, the first line of definition must be:
Signup and view all the answers
In case of multiple inheritance a derived class inherits,
In case of multiple inheritance a derived class inherits,
Signup and view all the answers
Which of the following is incorrect line regarding function template?
Which of the following is incorrect line regarding function template?
Signup and view all the answers
Which of the following is/are advantage[s] of generic programming?
Which of the following is/are advantage[s] of generic programming?
Signup and view all the answers
Which one of the following functions returns the total number of elements in a vector.
Which one of the following functions returns the total number of elements in a vector.
Signup and view all the answers
Assume a class Derv that is privately derived from class Base. An object of class Derv located in main() can access
Assume a class Derv that is privately derived from class Base. An object of class Derv located in main() can access
Signup and view all the answers
Each try block can have __ no. of catch blocks.
Each try block can have __ no. of catch blocks.
Signup and view all the answers
Two important STL associative containers are __ and __
Two important STL associative containers are __ and __
Signup and view all the answers
The mechanism of selecting function at run time according to the nature of calling object is called,
The mechanism of selecting function at run time according to the nature of calling object is called,
Signup and view all the answers
An abstract class is useful when
An abstract class is useful when
Signup and view all the answers
Public methods of base class can __ be accessed in its derived class
Public methods of base class can __ be accessed in its derived class
Signup and view all the answers
Multiple inheritance can be of type___
Multiple inheritance can be of type___
Signup and view all the answers
When a subclass specifies an alternative definition for an attribute or method of its superclass, it is __ definition in the superclass.
When a subclass specifies an alternative definition for an attribute or method of its superclass, it is __ definition in the superclass.
Signup and view all the answers
A function call is resolved at run-time in___
A function call is resolved at run-time in___
Signup and view all the answers
Study Notes
CS304 Object-Oriented Programming Final Exam
-
Question 1 (Marks: 1): Which of the following causes run-time binding?
- Declaring an object of an abstract class
- Declaring a pointer of an abstract class
- Declaring overridden methods as non-virtual
- None of the given
-
Question 2 (Marks: 1): Which of the following is the best approach if it is required to have more than one function with the same functionality implemented on different data types?
- Templates
- Overloading
- Data hiding
- Encapsulation
-
Question 3 (Marks: 1): When is a copy constructor invoked?
- A function does not return by value
- An argument is passed by value
- A function returns by reference
- An argument is passed by reference
-
Question 4 (Marks: 1): Can a class template not handle all the types successfully?
- True
- False
-
Question 6 (Marks: 1): Can a class template inherit from another class template?
- True
- False
-
Question 7 (Marks: 1): By default, what value are vector data items initialized to?
- 0
- 0.0
- 1
- null
-
Question 8 (Marks: 1): In Private, derived classes can convert parent pointers?
- specialization
- inheritance
- abstraction
- composition
-
Question 9 (Marks: 1): Which is/are an advantage(s) of generic programming?
- Reusability
- Writability
- Maintainability
- All of the given
-
Question 10 (Marks: 1): What do template functions use compared to ordinary functions?
- Greater Memory
- Lesser Memory
- Equal Memory
- None of the given options
-
Question 11 (Marks: 1): Which are friends of non-template friend functions?
- All instances
- One specific instance
- All instances of one type of data
- None of the given options
-
Question 12 (Marks: 1): When is a copy constructor invoked?
- A function does not return a value
- An argument is passed by value
- A function returns by reference
- An argument is passed by reference
-
Question 13 (Marks: 1): Can a pointer to a base class point to objects of a derived class?
- True
- False
-
Question 14 (Marks: 1): What keyword precedes a template argument?
- vector
- class
- template
- type*
-
Question 15 (Marks: 1): Which term relates to polymorphism?
- Static allocation
- Static typing
- Dynamic binding
- Dynamic allocation
-
Question 16 (Marks: 1): Which of the following is a multiple inheritance type?
- Public
- Private
- Protected
- All of the given
-
Question 17 (Marks: 1): If a class is privately derived from another class, which members of the derived class can be accessed from
main
?- Public members of the derived class
- Protected members of the derived class
- Private members of the derived class
- Protected members of the base class
-
Question 18 (Marks : 1 ): When is a copy constructor invoked?
- A function doesn't return by value
- An argument is passed by value
- A function returns by reference
- An argument is passed by reference
-
Question 19 (Marks: 1): When does a function call resolve in runtime?
- Non-virtual member function
- Virtual member function
- Both non-virtual and virtual member functions
- None of the given
-
Question 20 (Marks: 1): What are two important STL associative containers?
- set, map
- sequence, mapping
- setmet, multiple
- sit, mat
-
Question 21 (Marks: 1): When is an abstract class useful?
- We don't derive any class from it
- There are multiple paths from one derived class to another
- We don't want to instantiate an object
- You want to defer the declaration of the class
-
Question 22 (Marks: 1): Which of the following is an advantage of generic programming?
- Reusability
- Writability
- Maintainability
- All of the given
-
Question 23 (Marks: 1): What is the default initialization value of vector data items?
- 0
- 0.0
- 1
- null
-
Question 24 (Marks: 1): Which of the following are advantages of generic programming?
- Reusability
- Writability
- Maintainability
- All of the given
-
Question 25 (Marks: 1): What are the default initial values of vectors?
- 0
- 0.0
- 1
- null
-
Question 26 (Marks: 1):
CS304- Object Oriented Programming (Session - 3)
-
Question 27 (Marks: 1): How to declare template class as a friend?
-
Question 28(Marks: 1):
TwoDimensionalShape
andThreeDimensionalShape
vsSphere
andCube
- True
- False
-
Question 29 (Marks: 1): How to define a class template definition?
-
Question 30(Marks: 1): What does a derived class inherit in multiple inheritance?
-
Question 31 (Marks: 1): In private inheritance, the derived class can convert…
-
Question 32 (Marks: 1): Which is best approach if functions have same functionality but different types?
-
Question 33 (Marks: 1): What is the benefit of a subclass defining its own sub-classes instead of just its super-classes method?
-
Question 34 (Marks: 1): How many catch blocks can accommodate a single try block?
-
Question 35 (Marks: 1): What is the graphical representation of objects and classes named?
-
Question 36 (Marks: 1) Destructor function overloading:
- True
- False
-
Question 37 (Marks: 1): What is the behavior of a pointer to a base class that points to an object of a derived class regarding member function calls?
-
Question 38 (Marks: 1): Which operator cannot be overloaded ?
-
Question 39 (Marks: 1): Which of the following may not be an integral part of an object?
-
Question 40 (Marks:1): What is late binding?
-
Question 41 (Marks: 1): What is static binding?
-
Question 42 (Marks: 1): What is the role of a virtual function?
-
Question 43 (Marks: 1): How is an abstract class usefull?
-
Question 44 (Marks: 1): What is the advantage of having a template functions
-
Question 45 (Marks: 1): How many catch blocks can accommodate a single try block?
-
Question 46 (Marks : 1 ): How the information hidden within an object can be accessed?
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Related Documents
Description
Test your knowledge with this final exam for CS304 on Object-Oriented Programming. This quiz covers key concepts such as templates, run-time binding, and copy constructors. Prepare to evaluate your understanding of OOP principles and practices.