|Idioms and phrases|
The object oriented programming is commonly known as OOP. Most of the languages
are developed using OOP concept. Object-oriented programming (OOP) is a
programming concept that uses "objects" to develop a system.
A programming object has an ability to perform actions and has attributes. It performs just like real world entities for e.g. a motor bike. A bike performs actions such as ’Start’, ’Stop’ etc., and it has attributes like red color, 150 cc etc. So does an Object. Actions and attributes are represented by Methods and fields or properties respectively in programming language.
An object hides the implementation details and exposes only the functionalities and parameters it requires to its client. Here also an object shares the same concept as that of a bike. While driving a motor bike, we are unaware of its implementation details such as how it is developed, internal working of gears etc.? We know only the functions or actions it can perform.
• It presents a simple, clear and easy to maintain structure.
• It enhances program modularity since each object exists independently.
• New features can be easily added without disturbing the existing one.
• Objects can be reused in other program.
Abstraction is a process of identifying the essential details to be known and ignoring the non-essential details from the perspective of the end user.
The driver of a car needs to know how to apply brake, change gear and balance the steering. The driver need not know how the engine works
Structured Programming also supported abstraction with the help of data structures and functions. OOP provides better abstraction. While structured programming provides abstraction at the level of data structures and function, OOP provides abstraction at a higher level. Higher the abstraction level easier it is to understand.
A class represents description of objects that share same attributes and actions. It defines the characteristics of the objects such as attributes and actions or behaviors. It is the blue print that describes objects.
Encapsulation means keeping actions and attributes together under a single unit.
This can also be understood using a motor bike example. A bike has actions such as
’switch on light’, ’horn’ etc. and attributes such specific color, size, weight etc. Here
the actions and attributes are bundled together under a single unit, bike.
In a programming language, methods and properties that correspond to actions and attributes respectively are kept under a unit called object.
The advantage of encapsulation is that the implementation is not accessible to the client. The user has to know only the functionality of encapsulated unit and information to be supplied to get the result.
Top Aptitude topicsNumbers
Profit & loss
Time & distance
Time & work
Top GK topicsGeneral
Facts & Reasons
Days and years
Top Tech topicsAdobe CQ5
Top Vocabulary topicsSentence completion
Idioms and Phrases
High frequency words
Top ArticlesPig and Hive (Comparison)
Ramanujan Number - 1729
Interesting facts - Set 1
Interesting facts - Set 2
Interesting facts - Set 3
100 facts about tigers