Computer Flip Class

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 15

Computer

flip
class

I N T RO D U C TI O N A N D
P RI N CI P LE S O F O O P
introduction
As we all know a computer is a problem solving machine, a
computer solves a problem using a set of instructions and data. A
combination of both of these forms a program. Today we are going
to learn about the process of writing and execution of these
programs
INTRODUCTIO
N TO OBJECT
ORIENTED
Programming
Object Oriented programming
(OOP) is a programming
paradigm that relies on the
concept of classes and objects.
It is used to structure a software
program into simple, reusable
pieces of code blueprints (usually
called classes), which are used to
create individual instances of
objects
Object and class
Object - It's a real world entity, simply
everything surrounding us is an object .
It has its own set of attributes, behavior
and state.
Class - In object-oriented programming
, a class is a broad template/blueprint
under which objects having similar
attributes and behavior are grouped.
Principles of object oriented
programming

• Data abstraction
• Encapsulation
• Inheritance
• polymorphism
Data abstraction
Data abstraction is the process
of hiding certain details and
showing only essential
information to the user. It helps
in reducing programming
complexity and efforts.
Real life examples
of data abstraction
Mixer Grinder- The user
only sees jars and buttons
to operate mixer grinder
while technician is more
focused on the motor,
wiring and other internal
details of the mixer
grinder.
In object-oriented programming,
encapsulation refers to the bundling of
data with the methods that operate on
that data, or the restricting of direct
access to some of an object's components.-
Encapsulation is used to hide the values
or state of a structured data object inside
a class, preventing unauthorized parties'
direct access to them.
Real life example
of encapsulation
The real life example of
encapsulation is a washing
machine . The start button of
the washing machine
encapsulates many complex
things in it . Here abstraction
show essential feature like the
start button where
encapsulation hides all the
internal details of washing
that is filling up the water ,
starting the drum , rinsing etc.
Inheritance
Inheritance in Java is a mechanism in
which one class acquires all the properties
and behaviors of a parent class. It is an
important part of OOPs. Inheritance also
represents a relationship which is known as
a parent-child relationship.
real life
example of
inheritance
In real life, there are many good
examples if inheritance. The class
'student' is one of them. If we take
'student' as derived class of the base
class 'Human', then we see that the
class 'student' inherits many
attributes and behavior of the class
'Human'. They share many common
attributes in them such as name and
behavior such as eating, breathing,
sleeping etc. If we take one more
example on the derived class 'car' and
base class 'automobiles', we see that
they share common attributes such
as manufacturer, model no. etc.
and some common behavior such as
accelerating, applying brakes etc.
Polymorphism
Polymorphism is an ability of an
object to take multiple forms . In
simple words we can say that
polymorphism in java allows us to
perform the same action in many
different ways.
Real life examples
of polymorphism
1)A person at the same time can have
different characteristic. Like a man at the
same time is a father, a husband, an
employee. So the same person posses
different behavior in different situations.

2) Consider your Mobile phone. You can


save your Contacts in it. Now suppose you
want to save 2 numbers for one person. You
can do it by saving the second number
under the same name. Similarly, in an
object-oriented language like Java, suppose
you want to save two numbers for one
person. You must have a function, which
will take the two numbers and the person
name as arguments to some function void
create Contact(String name, int number1,
int number2).
Conclusion
So now we conclude that computers play an integral part in our day to day lives. We
hope that our presentation must have helped you in understanding the four pillars
of OOP the advantages of object oriented programming language and how easily we
can convert the individual components into real world object . Object-oriented
programming revolves around the concept of an object, which encapsulates data
and behavior acting on the data together. An object provides its services through a
well-defined interface. Since our brain is more used to seeing objects as a whole, we
can apply the same principles to the computer programs and it becomes very easy
way of learning and developing new skills . At the end We would thank our fellow
team members for passionately doing the work.

You might also like