Professional Documents
Culture Documents
Introduction to Objects Define Class & Objects Characteristics of OOPS History of C++ Difference Between C & C++ C++ Programming Structure
All around us in the real world are objects. Each object has certain characteristics and exhibits certain behaviour
OBJECT
Data Color : Black Year : 2008 Actions Start Stop Accelerate
Accounts
Personnel
The real world around is full of objects .We can consider both living beings as well as things as objects.For example,the different departments in a company are objects.
Data
Employee details Salary statements Accounts
Functions
Calculate salary Pay salary
Bills
Vouchers Reciepts
Pay bills
Tally accounts Transact with banks
Benefits of Object Oriented Programming approach are OOP offers better implementation OOP offers better data security OOP offers better code reusability OOP offers more flexibility OOP offers better manageable programs Large complexity in the software development can be easily managed User defined datatypes can be easily constructed
Maintenance
Design
Implementation
Testing
Development
Inheritance
Polymorphism Class
Grouping of data and methods into a single entity is known as Data Encapsulation
It is a technical name for information hiding. (i.e data hiding or data security)
Encapsulation
Class
Private
Public
Data abstraction enhances security as use of data is restricted to certain functions only. Abstraction is more used where you
want
only
certain
number
of
For Example
Class
Data abstraction is a process of identifying methods properties related much and to a
Attributes
Methods
Insects
Mammals
Reptiles
Amphibians
Humans
Non-Humans
Reusability
Programs can be broken into reusable objects Existing classes can be used with additional features Shape
Benefits of Inheritance
polymorphism allows a programmer to purse a course of action by sending a message to an object without concerning about how the software system is to implement the action Simply defined as Same thing can behave different ones
Class Artiste
Dancer
Class : Shape Methods : Draw Move
Sculptor Poet
Subclasses
Initialize
A class is what defines all the data members and the methods that an object should have. The class defines the characteristics that the object will possess; it could also be referred to as a blueprint of the object.
For Example
Polygon objects
Polygon class
Properties
Abstract
into Vertices Border Color Fill Color
Methods
Draw Erase Move
+
Simply defined as a structure that combines the objects with some attributes (data structure) and some behavior (operation)
Private
Data or functions Public
Data or functions
To access the member data and member function defined inside the class
Author of C++ is
Bjarne stroustrup
He invented this language in 1980's at
C++ was designed using two languages such as C Language which gives the low-level feature and Simula67 provides the class concept.
C++ Language Object Oriented Programming Language #include<iostream.h> we can use endl statement All Functions must be protyped It can be declared anywhere in a program, before they are used Return type must be specified
\n is used to go to the next line Function prototypes are optional Local variables declared only the start of a C program Return type for a function is optional
A class is an enhanced structure that provides Object-Oriented Features of C++ An object is an instance of a class which combines both data and functions together. Encapsulation is the process of combining member functions and the data it manipulates and keeps them safe from outside interferrence The three access specifiers in a class are
private,public,protected By default all members declared inside a class are private to that class C++ provides two pre-defined objects cin and cout for handling input and output
EXERCISES
1. Describe the Basic concepts of OOPS?
2. List the various applications of Object oriented Programming?