C plus plus Notes
.png)
Basics of C plus plus
.png)
Basics Of OOPs
.png)
Classes and Objects
.png)
Polymorphism and Inheritence
.png)
Exception Handling
.png)
File Handling and templates
Heading
Q
1
What is the need of Object-Oriented Programming paradigm?

Ans
OOP was developed were discovered in earlier approaches of programming. The fundamental idea behind OOP approach was to combine ‘data and functions that operate on that data’ into a single unit called object. It deals with overall organization. In the earlier approaches of traditional programming, few problems arose which were solved by OOP.

Q
2
Describe the characteristics of OOP.

Ans
i. Encapsulation- The wrapping up of data and function into a single unit (called class) is known as encapsulation. It is the most striking feature of a class. OOP encapsulates data (attributes) and functions (behavior) into packages called objects.
ii. Polymorphism- Polymorphism is another important OOP concept. Polymorphism means the ability to take more than on form. An operation may exhibit different behavior in different instances.
iii. Inheritance- Inheritance is the process by which objects of one class acquires the properties of objects of another classes. In OOP, the concept of inheritance provides the idea of reusability.

Q
3
Define Data Abstraction

Ans
Abstraction refers to the act of representing essential features without including the background details or explanation. Classes use the concept of abstraction and are defined as a list of abstract attributes such as size, wait, and cost, and function operate on these attributes.

Q
4
Define Data members and member functions.

Ans
The variables which are declared in any class by using any fundamental data types or derived data type are known as Data Members. The public data members can be accessed using the direct member access (.) operator. A member function of a class is a function that has its definition within the class. Members are accessed using dot (.) operator. Member functions can be defined within the class definition or separately using scope resolution operator (::).

Q
5
Compare and contrast the structured programming and object.

Ans

Q
6
List and define the two types of Polymorphism.

Ans
The two types of Polymorphism are-
1. Run time Polymorphism- If the appropriate member function could be selected while the program is running. This is called run time polymorphism. This could happen due to the fact that C++ supports a mechanism known as virtual function.
2. Compile time Polymorphism- The compiler uses the information from functions and operators at compile time, and, hence, is able to select the appropriate function for a particular call at compile time. This is called early or static binding or static linking or compile time polymorphism.

Q
7
Define Dynamic Binding.

Ans
Binding means matching the function call with the correct function definition by the compiler. When selection of function is done dynamically at run time, it’s called dynamic binding.

Q
8
Define Message Passing.

Ans
An OOP consists of a set of objects that communicate with each other. Message passing involves specifying the name of object, the name of the function (message) and the information to be sent.

Q
9
What is the return type of main ()?

Ans
The return type defines and constrains the data type of the value returned from a method. In many programming languages the return type must be explicitly specified when declaring a function.

Q
10
Compare and Contrast late binding and early binding.

Ans
