Page 1 :
Object Oriented Programming in c++ (OPPs), Object-oriented programming – As the name suggests uses objects in programming., Object-oriented programming aims to implement real-world enttes lile inheritancec, hidingc polymorphismc etc in programming., The main aim of OOP is to bind together the data and the functons that operate on, them so that no other part of the code can access this data except that functon., , Characteristics of an Object Oriented Programming language, , Class: The building block of C++ that leads to Object-Oriented programming is a, Class. It is a user-defined data type, which holds its own data members and member, functions, which can be accessed and used by creating an instance of that class. A, class is like a blueprint for an object., For Example: Consider the Class of Cars. There may be many cars with different, names and brand but all of them will share some common properties like all of them, will have 4 wheels, Speed Limit, Mileage range etc. So here, Car is the class and, wheels, speed limits, mileage are their properties.
Page 2 :
A Class is a user-defned data-type which has data members and member, functons., Data members are the data variables and member functons are the functons, used to manipulate these variables and together these data members and, member functons defne the propertes and behaviour of the objects in a, Class., In the above example of class Carc the data member will be speed limitc, mileage etc and member functons can apply bralesc increase speed etc., We can say that a Class in C++ is a blue-print representing a group of objects which, shares some common properties and behaviours., Object: An Object is an identifiable entity with some characteristics and behaviour., An Object is an instance of a Class. When a class is defined, no memory is allocated, but when it is instantiated (i.e. an object is created) memory is allocated., Syntax of class:, class person, {, char name[20];, int ID;, public:, void getdetaitls[]{}, };, int main(), {, person p1; //p1 is an object, }, , Encapsulation: In normal termsc Encapsulaton is defned as wrapping up of data and informaton under, a single unit. In Object-Oriented Programmingc Encapsulaton is defned as binding together the data, and the functons that manipulate them.
Page 5 :
Inheritance: The capability of a class to derive propertes and characteristcs from another class is called, Inheritance. Inheritance is one of the most important features of Object-Oriented Programming., , , , , Sub Class: The class that inherits propertes from another class is called Sub class or Derived, Class., Super Class:The class whose propertes are inherited by sub class is called Base Class or Super, class., Reusability: Inheritance supports the concept of “reusabilitync i.e. when we want to create a, new class and there is already a class that includes some of the code that we wantc we can, derive our new class from the existng class. By doing thisc we are reusing the felds and methods, of the existng class., , Example: Dogc Catc Cow can be Derived Class of Animal Base Class., , A derived class that implements all the missing functonality is called a concrete class., A concrete class is used to defne a useful object that can be instantated as an automatc variable on, the program stacl. The implementaton of a concrete class is defned. The concrete class is not intended, to be a base class and no atempt to minimize dependency on other classes in the implementaton or, behavior of the class., Concrete class is nothing but normal classc we can use as a base class or may not.Not compulsoryc it, can’t contain abstract methods.we can create object and worl with this class., , A concrete class is used to defne a useful object that can be instantated as an automatc variable on the, program stacl. The implementaton of a concrete class is defned. The concrete class is not intended to, be a base class and no atempt to minimize dependency on other classes in the implementaton or, behavior of the class.