Write One Page On Object Oriented Programming?
Write One Page On Object Oriented Programming?
ID NO: 12249
Section: ES
Subject: OOP
Teacher: Muhammad ASAD
Writing
The real world is a collection of objects which interact with each other to form an
environment. These objects have certain features and certain functions that define
the object the way it is.
For example, a microwave oven has certain features, such as it’s model number, it’s
capacity, the current heating temperature etc. It’s function includes switching on,
heating it’s contents, setting the timer, etc.
In programming, the microwave can be an object with it’s features as it’s data
members and it’s functions as it’s member functions.
Looking deeper,
The features of a microwave can be altered only by it’s functional units and not by
anyone or anything external to the microwave itself. This is true in programming
sense too. This is also known as abstraction and encapsulation.
Abstraction is the process of hiding data that is not necessary for the user to know
about. The internal working of a microwave needn’t be known to us for it’s
operation.
Encapsulation is the concept of binding the data members along with it’s member
functions into one single unit, as the name suggests. The working of a microwave can
only be controlled by it’s member functions, i.e. the buttons.
Object oriented programming involves several concepts:
Abstraction
Encapsulation
Polymorphism
Modularity
Inheritance
C++ programming
4. Create a class called “MyClass”.
Answer :-
Source code:-
Answer :-
7. Define a function inside the class, and we name it " myMethodin".
Answer :-
8. Define a function outside the class, and we name it " myMethodout".
Answer :-