Question Bank On Object Oriented Programming using C++
Question Bank On Object Oriented Programming using C++
Based on BCA Semester 3 IP University
Q2: What is polymorphism? Give one example to explain about it.
Q3: In what situations a copy constructor is invoked.
Q4: Give two differences between object oriented languages and procedure oriented languages.
Q5: What is initializer list?
Q6: What are template classes?
Q7: How garbage collection takes place? Explain with suitable example.
Q8: What are the operators that cannot be overloaded?
Q9: How can we access private data members through friend functions?
Q10: What are constant member functions?
Q11: Define a generic class. Give two examples.
Q12: When do you need deep copying?
Q13: Are templates memory efficient and why?
Q14: Illustrate the overloading of new and delete operator.
Q15: Write C++ program to show dynamic memory allocation. Also explain the concept.
Q16: What is a conversion constructor?
Q17: What is the significance of this keyword?
Q18: When you use static data members. Given an example.
Q19: What is the use of mutable data members?
Q20: What are the smart pointers?
Q21: What is the difference between multiple inheritance and multilevel inheritance?
Q22: What is the difference between overloading and overriding?
Q23: Write short notes on:
- abstraction
- function prototype
- nested classes
- functional and data decomposition
- encapsulation
- default arguments and its use.
Q24: What is the significant of ‘vptr’ in virtual functions.
Q25: How is the runtime polymorphism implemented in C++?
Q26: What are the different types of polymorphisms in C++.
Q27: What is the significant of pure virtual functions in C++.
Q28: Explain hybrid inheritance and aggregation with suitable examples.
Q29: Write different types of exceptions in C++.
Q30: What is the use of dynamic_cast in C++.
Q31: Write five examples for STL sequence containers.
Q32: What do you mean by dangling pointer.
Q33: What are the characteristics of inline functions? List the differences between inlines functions and macros.
Q34: Write the steps to delete a node with two children in binary search tree.
Q35: What are iterators?
Q36: What are namespaces? What is the advantage of having a namespace? Give suitable examples
Q37: Why static member functions do not receive ‘this’ pointer?
Q38: What do you mean by abstraction?
Q39: What do you mean by encapsulation?
Q40: What are template classes?
Q41: Write the syntax for defining a function outside the class.
Q42: Write a operator + of the string class which append two strings. The string is stored within the class as data, which is char[50].
Q43: What is binding? Describe static and run-time binding.
Q44: Discuss the methods to overload an operator in C++.
Q45: Write C++ programs to overload unary minus(-) with each method.
Q45: Write a function template that takes five parameters and returns the maximum of them. Also it
is to be initialized using int and float.
Q46: Why do we need virtual destructors?
Q47: It is legal to return local variables from a function which returns by reference. State true/ false with justification.
Q48: Write a code to initialize the pointer to a data member of a class.
Q49: Static member functions do not receive ‘this’ pointer. State true/ false with justification.
Q50: What are persistent objects?
Q51: Discuss ambiguity in multiple inheritance alongwith examples.
Q52: Write a short note on stream and its types.