KEMBAR78
OOPC Question Bank | PDF | Class (Computer Programming) | Inheritance (Object Oriented Programming)
0% found this document useful (0 votes)
216 views3 pages

OOPC Question Bank

The document contains questions related to Object Oriented Programming concepts in C++. It includes questions about classes, objects, inheritance, polymorphism, operator overloading, file handling and I/O streams.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
216 views3 pages

OOPC Question Bank

The document contains questions related to Object Oriented Programming concepts in C++. It includes questions about classes, objects, inheritance, polymorphism, operator overloading, file handling and I/O streams.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

CHAROTAR UNIVERSITY OF SCIENCE & TECHNOLOGY

DEVANG PATEL INSTITUTE OF ADVANCE TECHNOLOGY & RESEARCH


Department of Information Technology
CE144 Object Oriented Programming with C++
Semester: II
Academic year: 2022-23
Question Bank

1. What is the difference between Procedure Oriented Language and Object Orientated
Language?
2. List down the basic concepts of Object Oriented Programming. Explain any four concepts
in brief.
3. What are the application of Object Oriented Programming?
4. Explain cout and cin objects with example
5. Explain in detail Insertion Operator and Extraction Operator
6. Why do we need the Preprocessor directive #include ?
7. In C++, a variable can be declared anywhere in the scope. What is the significance of this
feature? What are disadvantage of it?
8. What do you mean by dynamic initialization of a variable? Give an example.
9. Which manipulator is used to control the precision of floating point numbers? Which
header file is required for that? Explain with example
10. Explain how a type cast operator used for explicit type casting in C++
11. Describe with example the use of enumeration datatype in C++
12. Explain with example how endl and setw manipulator works
13. Explain bool datatype and wchar_t datatype with example.
14. Explain Scope Resolution :: in C++ with example and its application
15. Explain Memory management operator new and delete in C++. Why memory
management operator are known as free store operator? What are the advantage of
using new operator as compared to the function malloc( )?
16. Explain Return by reference with example
17. What is inline function? What is the use of Inline function? Explain with example. How
does an inline function differ from a preprocessor macro?
18. Write a situation where an inline function may not work.
19. What are the default arguments? What are const Arguments to a functions? Explain with
example
20. What is function overloading? Explain with example when do we use this concept?
21. On what basis, the compiler distinguishes between a set of overloaded functions having
the same name?
22. What is class? Explain how does a class accomplish information hiding (data hiding), data
abstraction and encapsulation? Explain real life example of information hiding, data
abstraction and encapsulation.
23. What are Object? How are they created?
24. Explain the declaration of a class in C++. How will you define the member function of a
class? Is it possible to make a function inline even if it is defined outside the class?
25. Describe the mechanism of accessing data members and member function of a class in
the following cases: (a) Inside the main program. (b) Inside a member function of the
same class. (c) Inside a member function of another class.
26. Draw the memory allocation of a class having 3 data-members and two member functions
of 4 objects of the same class and also explain it.
27. Explain access specifiers public and private with example of a class. What is the difference
between normal function and member function of a class
28. Explain how to pass object as function argument ?
29. Explain in detail static data members of a class with example. When do we declare
member of a class as static? Justify the need of static members.
30. Explain in detail static member function with an example.
31. Can we pass class objects as function argument? Can we return an object in a function?
What are array of objects? Explain each with the help of an example.
32. Can we pass object of a class as a reference to function argument? Explain with example
33. What is a friend function? Explain in detail with example. What are the features of friend
function? What are the advantages and disadvantages of using friend function?
34. What is friend Class? Explain with example
35. Write a short note on pointer to data members and pointer to member functions of a
class.
36. Explain const member function and Local classes with an example.
37. What is a constructor? Is it compulsory to use constructor in a class?
38. What are the properties of a Constructor?
39. Explain Default constructor, Parameterized constructor and Copy Constructor. In a Class if
we write parameterize constructor then is it compulsory to write default constructor if we
want to create object without argument?
40. Can we have more than one constructor in a class? If yes, explain the need for such a
situation.
41. What do you mean by dynamic initialization of Objects? Why do we need to do this?
42. What do you mean by Const Objects?
43. Explain destructor with the help of an example. Differentiate between constructor and
destructor function in context of classes and objects using C++.
44. What is operator overloading? Why is it necessary to overload an operator?
45. List out the operators which cannot be overloaded. Also List out those operators which
can be overloaded by member function of a class but cannot be overloaded using friend
function
46. What is an operator function? Describe the syntax of an operator function.
47. What are the rules for overloading operators?
48. Explain Type conversion from basic type to class type with the help of an example
49. Explain Type conversion from class type to basic type with the help of an example.
50. Explain Type conversion from class type to class type with the help of an example
51. What are the three rules for defining a Casting operator function?
52. What is inheritance? Explain how it supports the concept of reusability of code. What are
various types of Inheritance?
53. Explain Single Inheritance with an example where a derived class inherits members of
base class privately as well as publicly. Suppose there is a display () function in both base
class and derived class. How can we call display () function of base class using objects of
derived class?
54. When do we use the protected access specifier to a class member? Explain the difference
between private access specifire and protected access specifire.
55. Explain Multilevel Inheritance with example.
56. Explain Hierarchical Inheritance with example
57. Explain Hybrid Inheritance with example.
58. Explain the concept of common constructor
59. What is virtual base class? When do we make a class virtual?
60. What is an abstract base class?
61. Explain how we write constructor in derived class when there is parameterized
constructor in base class. In what order are the class constructor called when a derived
class object is created?
62. Explain nesting of classes with an example.
63. What do you mean by Polymorphism in C++ Language? How is polymorphism achieved at
(a) compile time and (b) run time? Give example
64. Distinguish between Early binding (or static binding or static linking) and Late Binding (or
dynamic binding).
65. Explain pointer to object with an example.
66. Explain this pointer with example. What are the applications of this pointer?
67. Explain the concept of pointer to derived class ?
68. What is virtual function? Why do we need virtual functions? What are the rules for virtual
function?
69. What is the difference between virtual function and virtual class?
70. What is the difference between virtual class and abstract class?
71. What is pure virtual function? When do we make a virtual function “pure”? What is the
significance of making a function a pure virtual function
72. A constructor cannot be virtual but a destructor can be virtual”. Justify this statement.
73. What is a stream? What is input stream and output stream? Explain with diagram
74. Draw the hierarchy of the stream classes for console I/O operations.
75. Explain get() and put() function with example.
76. Explain getline() and write() function with example. What is the difference between cin
and getline() function used to read a string?
77. Explain the basic ios format functions for console I/O operations.
78. Explain various manipulators and their meaning defined in header file iomanip.
79. Explain various manipulators and their meaning defined in header file iomanip.
80. Draw the hierarchy of stream classes for file operations
81. Describe the various classes available for file operations.
82. What is a file mode? Describe the various file mode options available.
83. Explain the following functions for Manipulation of file pointers.
seekg() seekp() tellg() tellp()
84. Explain put(), get() , read() and write() function which are used for sequential input and
output operation for a file.
85. Explain all error handling functions for the file.
86. Explain the command line argument for a file.

You might also like