Features of Oops
Features of Oops
O
E S
U R
AT
E P S
F O
O DONE BY
A.JAIDEEP
CSE J
RA2411003020630
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
brands but all of them will share some common properties
like all of them will have 4 wheels, Speed Limit, Mileage
range, etc. So here, the Car is the class, and wheels, speed
limits, and mileage are their properties.
OBJECT
An Object is an identifiable entity with some characteristics
and behavior. 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.
Objects take up space in memory and have an associated
address like a record in pascal or structure or union. When a
program is executed the objects interact by sending
messages to one another. Each object contains data and
code to manipulate the data. Objects can interact without
having to know details of each other’s data or code, it is
sufficient to know the type of message accepted and the
type of response returned by the objects.
MESSAGE PASSING
Objects communicate with one another by sending and
receiving information. A message for an object is a request
for the execution of a procedure and therefore will invoke a
function in the receiving object that generates the desired
results. Message passing involves specifying the name of
the object, the name of the function, and the information to
be sent.
INHERITANCE
The capability of a class to derive properties and
characteristics from another class is called Inheritance.
Inheritance is one of the most important features of Object-
Oriented Programming.
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 a sub-
class is called Base Class or Superclass.
POLYMORPHISM