Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
2 views

Object-Oriented-Programming-Using-C-Characteristics-of-Object-Oriented-Programming-2

The document outlines key concepts of Object-Oriented Programming (OOP), including objects, classes, encapsulation, abstraction, inheritance, and polymorphism. It explains how objects are real-world entities, classes serve as blueprints for objects, and encapsulation and abstraction help in data management. Additionally, it discusses inheritance for code reusability and polymorphism for function and operator overloading, along with dynamic binding and message passing as communication methods between objects.

Uploaded by

devishapatel967
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Object-Oriented-Programming-Using-C-Characteristics-of-Object-Oriented-Programming-2

The document outlines key concepts of Object-Oriented Programming (OOP), including objects, classes, encapsulation, abstraction, inheritance, and polymorphism. It explains how objects are real-world entities, classes serve as blueprints for objects, and encapsulation and abstraction help in data management. Additionally, it discusses inheritance for code reusability and polymorphism for function and operator overloading, along with dynamic binding and message passing as communication methods between objects.

Uploaded by

devishapatel967
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Abhishek Dwivedi

Assistant Professor
Department of Computer Application
UIET, CSJM University, Kanpur
 Objects

 Classes

 Encapsulation

 Abstraction

 Inheritance

 Polymorphism
 Objects: Object is a real world entity, In other words,
object is an entity that has state and behavior. Here,
state means data and behavior means functionality.
Object is a runtime entity, it is created at runtime.
Object is an instance of a class. All the members of
the class can be accessed through object. As the
name object-oriented implies, objects are key to
understanding object-oriented technology. There are
many examples of real-world objects: dog, television
set, bicycle etc.
 Classes: A class is the building block that leads to
Object-Oriented programming. 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.
 Encapsulation is defined as wrapping up of data and
information under a single unit. In Object-Oriented
Programming, Encapsulation is defined as binding together
the data and the functions that manipulate them.
Encapsulation also leads to data abstraction or hiding. As
using encapsulation also hides the data. In the above
example, the data of any of the section like sales, finance or
accounts are hidden from any other section.
 Data abstraction is one of the most essential and important
features of object-oriented programming in C++.
Abstraction means displaying only essential information
and hiding the details. Data abstraction refers to providing
only essential information about the data to the outside
world, hiding the background details or implementation.
 Using inheritance object of one class can inherit or acquire the
properties of the object of another class. Inheritance provides
reusability of code.
As such we can design a new class by acquiring the properties and
functionality of another class and in this process, we need not modify
the functionality of the parent class. We only add new functionality to
the class.
 Sub Class: The class that inherits properties from another class is
called Sub class or Derived Class.
 Super Class: The class whose properties are inherited by sub class is
called Base Class or Super class.
 Reusability: Inheritance supports the concept of “reusability”, i.e.
when we want to create a new class and there is already a class that
includes some of the code that we want, we can derive our new class
from the existing class. By doing this, we are reusing the fields and
methods of the existing class.
 Dog, Cat, Cow can be Derived Class of Animal Base
Class.
Polymorphism means many forms. Polymorphism is an important
feature of OOP and is usually implemented as operator overloading or
function overloading. Operator overloading is a process in which an
operator behaves differently in different situations. Similarly, in function
overloading, the same function behaves differently in different
situations.

 Dynamic Binding: OOP supports dynamic binding in which function


call is resolved at runtime. This means that the code to be executed as a
result of a function call is decided at runtime. Virtual functions are an
example of dynamic binding.

 Message Passing: In OOP, objects communicate with each other using


messages. When objects communicate, information is passed back and
forth between the objects. A message generally consists of the object
name, method name and actual data that is to be sent to another object.

You might also like