What is parameterized constructor? Give an example.

Parameterized Constructor: We know that when we create an object the constructor function gets execution automatically. Consider the following lines of codes,

What is namespace?

Namespace: Namespace defines a scope for the identifiers that are used in the program. To use we will do the following

What is this Pointer? Give an example.

The this Pointer: When a function of a class is called by an object of that class, each variable gets an pointer which points to that calling object, meaning that this variable was called by that object or this variable is under that object. This pointer is called this pointer. To clarify consider the following lines of codes,

What is function overloading? Discuss this.

Function Overloading: Overloading refers to the use of the same thing for different purposes. When the same name for different functions is used that is called function overloading. The functions are then distinguished by their parameters or argument lists.

Write some properties of constructor?

Properties of Constructor Function: Following are some properties of Constructor Function

What is constructor?

Constructor: A constructor is a ‘special’ function whose task is to initialize the objects of its class. It is special because its name is the same as the class name. A constructor is executed whenever object of its class is created. It is called constructor because it constructs the values of data members of the class.

Write down some properties of static member function.

Properties of Static Member Function: Following are some properties of Static Member Function

How does a static member variable or static data member differs from a non-static variable or data? Explain with an example.

Static Data Member and Difference with Non-static Data Member: In general when we declare some objects of a class, each object is allocated with memory space for each variable of the class separately under them as given below,

What is inline function? Give some uses of it.

Inline Function: Every time a function is called, it takes a lot of extra time in executing a series of instructions for tasks such as jumping to that function, saving registers, pushing arguments into the stack and returning to the calling function. Also when a function is small a large percentage of execution time may be spent in such tasks to be done.

What is friend function? Explain the use with an example.

Friend Function:

Friend functions are those functions which can access all the functions and  variables of a class though it is not a member function of that class. Actually to share a function among two or more classes friend functions are used. If it is declared so, then it will able to access all variables and functions of those classes.

Is it possible to return an object from a function? Justify your answer with an example.

Return of an Object from a Function: Yes it is possible to return an object from a function. An object can be returned to the call of its function by another object. For the justification considering the following program,

Is it possible to pass an object from one function to another ─ justify from an example.




Passing Objects: An object can be used as a function argument in the following two ways,

  1. pass-by-value
  2. pass-by-reference

What do you understand by class and object?

            Class: Class is an user-defined data type which works same as the built in data types. A class contains some variables and functions to access those variables. These stay tied together and can not be accessed by other functions of other classes without permission. In that way data of a function under variables stay secured. Objects are the variables of the class type. When objects of a class type have been declared, each object is associated with the data of that class type. For example, if we take Fruit as a class we can declare mango, banana etc as object of this class and it is the better practice to keep same functionality tied together. The syntax is as follows,

                                                            class class_name
                                                            {
                                                            };

What is meant by the statement #include?

#include<iostream>: This is a directive which causes the preprocessor to add the contents of iostream, which is a header file and must be added above all of a program where input/output statements has been used. We will include the header file with the statement

What are the basic features of OOP (Object Oriented Programming).

Object Oriented Programming is programming concept which is focused on object rather than actions and data rather than logic.

To design and to use system, OOP offers some outstanding features including the followings,




What are the problems of POP? How they can be solved in OOP?

Problems of POP: 

It is true that the programs created using POP can be extremely efficient and high-performance, but the main problem is the maintenance. Some other problems includes the followings,


List a few areas of application of OOP concept or technology.

Great deal of excitement and interest in software engineers can be found in using OOP. Applications of OOP are gaining importance in many areas. The most important area is the user interface design such as windows. It has also got importance in real business systems as they are very complicated and use many methods and OOP can simplify those. 



What are the main characteristics of Procedure Oriented Programming (POP)?

Procedural or Procedure Oriented Programming (POP): 

As the name implies, Procedure Oriented Programming contains step by step procedure to execute. Here, the problems get decomposed into small parts and then to solve each part one or more functions are used. Thus in POP approach, the problem is viewed as a sequence of things to be done, such as, input taking, calculating and displaying. The primary focus stays on functions which will be used to accomplish each task.

Read More: What is Procedure Oriented Programming (POP)?

“POP provides emphasis on doing things, but OOP on the data”─ Do you agree with this statement? Justify your answer.

Yes I agree with the given statement, “POP provides emphasis on doing things, but OOP on the data”.

Justification of My Acceptance: In the case of a large program created using the concept of Procedure Oriented Programming, sometimes we declare some Global Variables which will be used by all the functions of the program. As we know that variable generally defines memory locations, thus in the case of a global variable,

Differences between OOP and POP?

Object Oriented Programming: Object Oriented Programming is programming concept which is focused on object rather than actions and data rather than logic. 

Read More: What is Object Oriented Programming (OOP)?

Procedure Oriented Programming: As the name implies, Procedure Oriented Programming contains step by step procedure to execute. Here, the problems get decomposed into small parts and then to solve each part one or more functions are used. 

Read More: What is Procedural or Procedure Oriented Programming (POP)?

Differences between OOP and POP?

What is Object Oriented Programming (OOP)?

Object Oriented Programming (OOP): 

Object Oriented Programming is programming concept which is focused on object rather than actions and data rather than logic. 


Object Oriented Programming concept is a way to remove some faults or limitations of POP (Procedure Oriented Programming). It puts much importance on data and does not allow data to move freely around the whole program. OOP binds particular data and functions of data in units called objects which protect data from getting motivation by other functions. Thus in OOP, we put particular data and functions in a particular object and by calling a function using an object of that object type, we call those data and function. Actually these objects are the decomposed small parts of the problem to solve. That’s why, data is much more secured here. However, a function of an object may be able to access methods and properties of other objects, based on how the objects been created.









What is Procedural or Procedure Oriented Programming (POP)?

Procedural or Procedure Oriented Programming (POP): As the name implies, Procedure Oriented Programming contains step by step procedure to execute. Here, the problems get decomposed into small parts and then to solve each part one or more functions are used. Thus in POP approach, the problem is viewed as a sequence of things to be done, such as, input taking, calculating and displaying. The primary focus stays on functions which will be used to accomplish each task.